1
\$\begingroup\$

How do you stop an animation and then resume on the same frame where you paused? I tried:

if (paused) {
    anim.speed = 0;
} else {
    anim.speed = 1;
}

Sure, it pauses and plays but it doesn't resume on the frame it paused. It starts over the animation. I also tried playing around the Speed field in Animator (instead of via code) while the animation is playing and its the same way. When the animation is playing and I change the value of Speed, the animation doesn't slow down, it gets reset.

\$\endgroup\$
2
  • \$\begingroup\$ Do you need an Animator component for this case, with its graph control logic? Or would an Animation component serve your needs? \$\endgroup\$
    – DMGregory
    Oct 12, 2019 at 10:49
  • \$\begingroup\$ Hi, I found out the problem. I tried creating from scratch and removing any extra and the anim.speed is actually working. I found out that I had extra state transitions happening in my original project that's why the animation was resetting. \$\endgroup\$
    – g_b
    Oct 13, 2019 at 1:42

1 Answer 1

1
\$\begingroup\$

I found out my problem. I tried creating from scratch and removing any extra and the anim.speed is actually working. I found out that I had extra state transitions happening in my original project that's why the animation was resetting.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .