Hello, My questio is the following:
I have a script A which sends a message (via sendMessage) to a function in script B.
In script B, it looks like this:
function messageReciever(recievedValue : int){
//Script does something here
}
now, my question. I wat no call this function with something like this:
if(x == 2)
{
messageReciever();
}
But when I do this, i get an error message… 
Thanks for help
What is the error message?
Thanks for the fast response, the error message is:
Assets/scripts/PlayerRoute.js(35,27): BCE0017: The best overload for the method ‘PlayerRoute.MapReading(int)’ is not compatible with the argument list ‘()’.
It means that you must pass an int to the function…since you defined the function to require an int to be passed.
e.g.
// given:
function messageReciever(recievedValue : int){ // some code }
messageReciever(1); // This call is valid, as you are passing the required parameter
messageReciever(); // This call is not, no int is being passed
Yes, that works. Thank you very much 