Why is my animation (animator) delayed ?
I made a game and when you die the score moves from top right to the middle of the screen using an animation. When you press Retry I reverse the animation by by setting the a speed parameter which is used as a speed multiplier in AnimationState.
While the parameter switches value (from 1.0 to -1.0 and or the other way around) the animation has a delay. I also noticed the longer you wait pressing retry, the longer it'll take for the animation to start. I do have to mention the animation doesn't have a transition to an idle state, so it probably means the animation time is moving > 1.0. I tried setting normalizedTime, but this didn't work either.
Does anyone know how to fix this?
Answer by noodlesdev · Nov 25, 2017 at 01:31 PM
Okay I fixed it. Apparently I had to use ForceStateNormalizedTime()
as normalizedTime
was going above 1.0f and below 0.0f.
for any that this can help, play animation forwards and backwards
// go forwards
mainAnimator.SetFloat ("Direction", 1);
mainAnimator.PlayInFixedTime("AnimName",-1,0 );
//go backwards
mainAnimator.SetFloat ("Direction", -1);
mainAnimator.PlayInFixedTime(("AnimName",-1,1);
Hi, I am having the same proble, could you share how you used ForceStateNormalizedTime() in your class? Edit: NV$$anonymous$$ i figured it out, thanks for the answer guys, both of you
How did you used ForceStateNormalizedTime(), I am having the same trouble, and I didn't get it.