I have a parent object which I want to have send information to it’s children objects which determines their movement, which looks like this:
gameObject.BroadcastMessage("receiveDirection", minXRange, maxXRange);
And the corresponding function in the child and the object sending the message:
function receiveDirection(minXRange : float, maxXRange : float)
However, when I try this, I get the following error:
“No appropriate version of ‘UnityEngine.GameObject.BroadcastMessage’ for the argument list ‘(String, float, float)’ was found.”
Meanwhile, everything works fine when I use:
gameObject.BroadcastMessage("receiveDirection", minXRange);
Is this the expected behaviour? Can I only send only one object/variable as part of BroadcastMessage (not counting it’s sending options, of course) or have I made a mistake?
Thanks.