Search Unity

Should Animancer stop all animations when deactivated?

Discussion in 'Animation' started by Kybernetik, Mar 17, 2019.

?

What should AnimancerComponent.OnDisable do?

  1. Stop all animations so the object is back in its original state when re-enabled

    80.0%
  2. Pause all animations so they resume from their current state when re-enabled

    20.0%
  1. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I just saw this thread https://forum.unity.com/threads/losing-animator-state.307667/ in which people are finding the behaviour of the Animator component when it is deactivated to be unhelpful, specifically the way it loses the state of the AnimatorController.

    My Animancer plugin (link in my signature) is an alternative animation system which currently does the same thing, but it does so by choice (it literally calls StopAll in OnDisable). So that thread got me wondering whether that is the best way for it to work or if I should change it in the new version I'm currently working on.

    The current behaviour (stop on disable) seems like the best approach for object pooling. You deactivate an object and then when you reactivate it everything is ready to start from scratch in exactly the same way it did when first instantiated.

    I can't actually think of a situation where you would want to keep the current animations, but evidently everyone in that thread wants to do so. Any suggestions on what sort of situations that might be useful for?

    So how do you think it should work? Which option should be the default? Should it be selectable in the inspector or need to be set via a script like the Animator.keepAnimatorControllerStateOnDisable property? Any other thoughts?