How do I remove the latency/delay/pause when starting a clip with animator.Play()?
Hey all, unity newbie here.
I'm using Input.GetAxis to move an object. There is a noticeable pause before the object starts to move when calling animator.Play() on rigged geo from Maya, vs. calling AddForce() on a RigidBody object. The RigidBody responds immediately, but the rigged obj always pauses right before it starts to play the clip. The latency seems to be happening in the clip itself. If the 'idle' clip time is 0.0f, and on input I run animator.Play("Clip", 0.2f), I can see the blue bar under the clip in the Controller jump to 0.2f immediately, THEN it pauses for a frame or two, before playing the rest of the clip in real time as it should. This happens whether I call Play() in Update or FixedUpdate.
FYI i am setting the animation speed to say 1.0f or 2.0f right before playing it and setting it to 0.0f to 'pause' the clip at the end with a function called from an animation event, as I only want to run it in response to input and reset if it reaches the end of the clip. This is working fine and it makes no difference if I use animator.Speed() directly or an Animation Controller parameter as a multiplier.
Any ideas how to get rid of that initial delay, or is that "just the way it is"?
Thanks!
Your answer
Follow this Question
Related Questions
my animation glitches when i add more keyframes 0 Answers
Animations unwanted movement and rotation after updating 0 Answers
Trouble with Humanoid Avatars 1 Answer
Problem of trancicion of states with the anystate, mecanim 0 Answers
How do play an animation clip from Timeline, but mirrored? 0 Answers