hey i am doing the walker boy studios tutorial and am trying to add an animation event. For some reason when i type in the code it doesnt work. will some one check my code along with the code from unity app 9 10 animation event key in Walker Boy Studio - Video Training and Tutorials on Vimeo that video (it is 1:49 in)
I alread tried getting rid of The extra code and that didnt help.
Thank you.
#pragma strict
function Start () {
}
function Update () {
}
function PrintEvent (num : int){
Debug.Log("Hello Event"+ num);
}
Is it possible that you changed the functions name after you created the AnimationEvent?
Those things are important:
Attach the script to the object you want to animation
After that create your AnimationEvent and select the function you want to fire.
The only reason for a “has no receiver” error i can think of is that you created an AnimationEvent and then you changed the functions name or it’s parameters which changes the signature of the function. In other words you have an AnimationEvent that tries to call a function that doesn’t exist.
Another point is that you can have a bunch of animation events at the same frame in animation view but you see only one of them. Take care that there are no old events containing method names that have changed behind of newer ones.