# Pausing animation and resuming on same frame

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.

• Do you need an Animator component for this case, with its graph control logic? Or would an Animation component serve your needs? – DMGregory Oct 12 at 10:49
• 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. – g_b Oct 13 at 1:42