- Home /
A quick question about animation frames
I am rather curious if it's at all possible to obtain the current playing frame of a gameobject's animation in a script. This would be very helpful to synchronize damage arrays with the frame, so certain frames do certain damages. If not, Does anyone have any suggestions on how that or something similar could be done?
Answer by Bunny83 · Jun 15, 2011 at 11:02 PM
Animations in Unity are time based. all movement is interpolated based on the animation time. There is no "current" frame, the animation is always in between two keyframes. Animations consists of keyframes but they are just the "guidline" for the animation.
What you can do is: setup AnimationEvents to do something at a specific moment,
or check AnimationState.time yourself.
Your answer
Follow this Question
Related Questions
Need help with animation rewind 1 Answer
Play sound on anim frame 1 Answer
How can I do frame by frame hitbox control for a 2D fighting game character? 0 Answers
Select frame for Animation 1 Answer
How to run an animation mouse click. 2 Answers