I have only the main question. I am trying to learn how to use functions with singlescript, and I found out that when you create a function using something like
function Example(text)
{
print(text);
}
and then call it using
Example();
you can insert a string or number in parentheses on the last piece of code in parentheses, and it will go through and insert itself into a previously created function. In this case, it prints everything that I type in parentheses.
Now, my question is: if this works, then why are there no functions in which I pass two numbers, and ask them to add work? The code I'm trying to use looks like this:
Addition(4, 4);
function Addition(a, b)
{
print(a+b);
}
When I try to accomplish this, Unity tells me
The + operator cannot be used on the left side of the Object type and the right side of the Object type.
Javascript 9 , script . , , . .