- Home /
Get Frame info from Animator
So what I'm attempting to do is have the Enemy sprite fire on the 3rd frame of their Shoot Animation. How do I do this? I've looked it up and it seems I can't actually extract the frame number from the Animator or Animation data types. I've tried some alternate approaches like setting variables in the animator, but that seems impossible. So how do I, using the animator, get the current frame of an animation so I can sync things up?
Answer by tanoshimi · Jan 11, 2014 at 06:52 PM
I don't believe you can get a specific frame number from an animation state, but you can solve your problem by adding an animation event in the 3rd frame of the animation itself, and call your enemy firing code from that event.
This appears to be exactly what I was looking for. Thanks.