- Home /
Check (and record) animation time/frame then go back to it when called
I am making a game that kinda has to do with saving a game and loading it again. I am going to be using animations to move things, but want to be able to check how far through an animation it is, then record that. Later I want to be able to load up that animation to where it was recorded.
How would I go about checking the progress/frame/time of an animation, then later skipping to that time?
Thanks in advance!
-Keavon
Answer by BerggreenDK · Oct 01, 2011 at 09:38 PM
Every animation has a "time" and a "speed" attribute. Both can be read/write.
Check the Script reference: http://unity3d.com/support/documentation/ScriptReference/Animation.html
You find the speed and time inside the current animation state as every animation has its own animation state:
http://unity3d.com/support/documentation/ScriptReference/AnimationState.html
Thank you! AnimationState-time is exactly what I needed to set it! But how would I go about checking what it currently is?
Your answer
![](https://koobas.hobune.stream/wayback/20220612232800im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to record the time of pressing the UI buttons, and repeat the press. 2 Answers
Animation Stop and Stay 1 Answer
Animation plays without a bool, but after adding it just goes still 0 Answers
Animator idle minimal delay 0 Answers
Animation Window: How to scale keyframes to increase time? 9 Answers