- Home /
Question by
koushik 1 · Sep 30, 2010 at 06:11 AM ·
animationjavascriptframecount
how to count which frame in running in an animation
how to count which frame in running in an animation
Comment
Answer by runevision · Sep 30, 2010 at 09:00 AM
Animations in Unity don't playback one frame at a time, but rather are played back continuously. See this description in the manual: Animation Playback and Sampling
Thus, time is measured in "time" (in seconds) and not in frames.
In order to see the current time of an AnimationState, just query the time property of that state. For example, to see the current time of an animation called "Run" you can use this:
var currentTimeInRunAnimation = animation["Run"].time;
Your answer
Follow this Question
Related Questions
2D Sprite animation - How do I jump to the next frame? 0 Answers
Using animations in prefabs 1 Answer
How do I animate a 2D sprite? 1 Answer
A counting script? 1 Answer
Expecting EOF found else?? 1 Answer