- Home /
Make Mecanim animation play completely dependent on framerate?
I'm at a loss and after searching all over the forums and the docs, I feel I've tried everything. For the specific demo I'm working on, I'd like the speed of the Mecanim animation to be locked to/dependent on the framerate, not dependent on the time (so say, we'd like 2 frames of animation to play every single frame, not every single second, so if the ingame FPS drops the animation playback speed would slow down as well). I think it's basically the equivalent of the animation frame updating in Update() rather than updating based on Time.deltaTime, if that makes sense?
I've tried changing the "Update Mode" setting of the Animator component in the inspector to "UnscaledTime" with no luck. I've also tried doing it through code:
GetComponent<Animator>().updateMode = AnimatorUpdateMode.UnscaledTime;
And for some odd reason, that won't change the Animator's update mode at all. I've also tried this:
GetComponent<Animator>().SetTimeUpdateMode(UnityEngine.Experimental.Director.DirectorUpdateMode.UnscaledGameTime);
Also unsuccessful, no change. All I'd like to do is make the mecanim animation playback speed dependent on the framerate, not depend on the time. There must be some simple solution to this, I would imagine? Thanks in advance for the help!