Hi, I have a reoccurring problem when I try to communicate between scripts.
I usually use:
MyScript.SendMessage ("MyFunction", Variable)
but when I want to send two variables like this:
MyScript.SendMessage ("MyFunction", Variable1, Variable2)
it bugs up saying:
No appropriate version of ‘UnityEngine.Component.SendMessage’ for the argument list ‘(String, Variable Type, Variable Type)’ was found.
I figure it means that SendMessage does not support more than one Variable.
So I found out that when I wanted to send more than one variable I had to use this syntax:
MyScript.MyFunction (Variable1, Variable2)
but sometimes, not always, it bugs up saying:
‘MyFunction’ is not a member of ‘UnityEngine.Component’.
And I have never been able to send just one variable like this:
MyScript.MyFunction (Variable)
which gives exactly the same error.
Other than the fact that apparently I have to use SendMessage for 1 or less variables, and MyScript.MyFunction for more than 1 Variable, I haven’t been able to find any consistency in the occurrence of this problem, sometimes it works flawlessly, other times it bugs up like this.
I have tried searching the forums but I have not been able to find any post that had a working solution for this problem, and the only thing I can think of is the possibility that some function names just doesn’t work?