Hi, can someone please tell me why this does not work, I’ve attached the animation to the player, When I press P it goes to the ThrowFireBall function but nothing happens, no errors, nothing, if I remark it out and just add the Throw animation it works fine, and my fireBall function works fine to … ???
var targetClipName : String = “Throw”; //Where should the Event be added? (the name of the AnimationClip)
var throwTime : float = 0.3; //When should the function be called?
var throwFunctionName : String = “fireBall”; //What’s the name of the function?
function ThrowFireBall() {
var throwEvent : AnimationEvent = new AnimationEvent();
throwEvent.time = throwTime;
throwEvent.functionName = throwFunctionName;
animation[targetClipName].clip.AddEvent(throwEvent);
}