Animator doesn’t reset after disabling and re-enabling GameObject (freezes on last keyframe in Unity 2021.3.45f2)

Hi everyone,

I’m running into an issue with the Animator component after updating to Unity 2021.3.45f2.
Previously, my animation system worked fine, but now when I disable and re-enable a GameObject that has an Animator, the animation freezes at the last played keyframe instead of resetting to its default state.

Here’s the setup:

  • I have a GameObject named BG with an Animator and three animation clips: AnimCheck, AnimCheck1, and AnimCheck3.
  • There are two UI buttons:
    • Start → plays the AnimCheck1 animation clip.
    • Stop → stops the animation.
  • There’s also a Reset button (different GameObject) that disables the BG GameObject.
  • A ResetAnim button re-enables the BG GameObject.

Expected Behavior:

When the BG GameObject is re-enabled, the Animator should return to its default / idle state (AnimCheck), so the animation looks reset — as it did before disabling.


Actual Behavior:

If I disable the BG GameObject while AnimCheck1 is playing, and then re-enable it:

  • The animation freezes on the last keyframe where it was stopped.
  • The Animator does not reset or revert to its entry state.
  • When I click Start again, AnimCheck1 plays correctly from the beginning.
  • But immediately after re-enabling BG, it shows a frozen frame instead of resetting visually.

This behavior only started after updating Unity to 2021.3.45f2.
Before the update, re-enabling the GameObject always reset the Animator correctly.


What I’ve Tried:

I’ve already tested common workarounds:

  • animator.Rebind()
  • animator.Play("AnimCheck", 0, 0f)
  • Reassigning the RuntimeAnimatorController
  • Disabling and re-enabling the Animator component
  • keepAnimatorControllerStateOnDisable = false
  • Destroying and recreating the Animator component

None of these approaches restore the original reset behavior — the animation always remains frozen on the last frame when the GameObject is re-enabled.


Question:

Is this a known regression or intended change in Unity 2021.3.45f2?
If not, how can I properly reset the Animator’s state so that when a GameObject is disabled mid-animation and later re-enabled, it returns to its default entry state instead of staying frozen?


Environment:

  • Unity Version: 2021.3.45f2
  • Platform: Android/iOS (reproducible in Editor too)
  • Animator Type: UI GameObject with Animator component and simple state transitions
  • Issue: Animation state persists / freezes after GameObject is re-enabled

Would really appreciate if the Unity team could confirm whether this is a regression or suggest a clean way to reset the Animator state on re-enable.

Thanks in advance!

Hi @FrancisArul,

What version of Unity did you upgrade from?

In the meantime, please consider patching your game directly using the patcher tool. The patcher can also be integrated into your build pipeline to automatically patch builds that you create with your current Editor version if upgrading turns out to be unfeasible.

Hi @LeonhardP. I have updated the unity version from 2021.3.17f1

I also tried rolling the project back to Unity 2021.3.17f1, but the issue persisted there as well.

Short answer What you’re seeing is almost certainly the Animator “sticky pose” behavior rather than your controller truly not resetting. On disable, Unity leaves the last sampled values on the scene objects. When you re‑enable, the state machine may go back to its entry state, but unless that entry state writes all animated properties, the last pose remains visible. This shows up most often when the idle state doesn’t key every property or has Write Defaults turned off. It became more noticeable in later 2021 LTS builds due to changes in evaluation order, so it feels like a regression, but it’s a known behavior.

How to fix or work around Pick one of these approaches (they are compatible and you can mix them):

  • Make the idle/reset state actually write the pose
    • Ensure AnimCheck keys every property that can be animated by AnimCheck1/3 (e.g., anchoredPosition, rotation, scale, color). Add one frame with your default values.
    • Or enable Write Defaults on the idle state so it forcibly writes default values for properties not keyed in that state. This is the simplest fix for UI animators where you truly want a “hard reset.”

Let me know if that works for you.