Hi,
I am trying to use the UnitySendMessage function in my App. The problem is that I get the message:
The setup is rather simple. I have a script named animationController.js attached to an object named Hero.
This script contain a function Run as follows:
function Run(msg:String)
{
this.animation.wrapMode = WrapMode.Once;
this.animation.CrossFade("WalkRun");
this.animation.wrapMode = WrapMode.Loop;
this.animation.CrossFade("RunForward");
currentAction = run;
}
This script runs very well from within unity. I have no problem whatsoever with it.
My call in XCode is the following:
UnitySendMessage("Hero", "Run", "text");
I have done many tries including:
- Change the name of the object Hero in the call. In this case, the message says that there is no such object. I conclude that the object Hero is found and sound.
- Change the name of the methode for something like animationController.Run; but this does not help a bit.
- I checked in the Assembly-UnityScript.dll file and I do find my script function. The Run one looks like this:
m_animationController_Run_string:
_m_4:
.byte 13,192,160,225,128,64,45.......etc.
Considering the number of people who actually succeed in using UnitySendMessage, I must be doing something wrong but I cannot spot that very thing.
Any help is very much appreciated.
Thanks.