I have a character that I kick off a “attack” animation for. When it’s 3/4 of the way through, I want it to signal the person being attacked to perform a “defend” animation.
Is there any way to setup triggers in an animation sequence?
Or a way to signal that it’s complete with one animation?
isPlaying isn’t cutting it depending on when things are happening.
Ah, that’s pretty cool actually. Now if I can just get animation to work in the editor.
I’m trying to move a light across the screen over a few seconds but it’s not creating keys. I’m following the tutorial but must be missing something obvious.
Hmm, for some reason, my imported model has animations that say “Read-Only”. Any idea how to edit those? I want to add events to them to play sounds at certain points for example.
I have the same problem. Apparently it only works for non-imported animations.
I haven’t tried creating the event via code, only in the editor, maybe it works?
What I did was something like this:
var animationSegmentTime0 : float = 0.2; //Before attack
var animationSegmentTime1 : float = 0.5; //After attack
//The sum of both segments equals the total
//animation time
function DoAnimation() {
animation.Play("myAnimation");
yield WaitForSeconds(animationSegmentTime0);
DoAttackEffects();
yield WaitForSeconds(animationSegmentTime1);
}
It’s a manual way to do the Animation Events. If there’s a better way, please let me know.
You can’t edit the animations that are imported, but you can copy those animations, add the action, then tell your model to use the copy instead of the one from the import.