Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Can't Exit AnimationMode

Discussion in 'Animation' started by Silly_Rollo, Jan 17, 2019.

  1. Silly_Rollo


    Dec 21, 2012
    I have a pretty standard animation preview script like is featured in the docs for AnimationMode doing stuff like
    Code (CSharp):
    1. AnimationMode.BeginSampling();
    2. AnimationMode.SampleAnimationClip(animator.gameObject, _currentAnimation, _displayTime);
    3. AnimationMode.EndSampling();
    4. SceneView.RepaintAll();
    and at the end I
    Code (CSharp):
    1. AnimationMode.StopAnimationMode();
    Unfortunately I can't ever exit Animation Mode. The controller keeps a blue colored checkbox and my model doesn't revert to it's pre-animated state. I actually added a button
    Code (CSharp):
    1. if (AnimationMode.InAnimationMode() && GUILayout.Button("End Animation Mode")) {
    2.       AnimationMode.StopAnimationMode();
    and you can hammer it and nothing happens. How do I exit? This is 2018.3.0f2

    Edit: Bah I restarted and immediately tried it and it was working properly. I think if it errors out even once (due to script or animation error) it'll be screwed until the next restart. So I need to restart whenever that happens.
    Last edited: Jan 17, 2019
    sean244 likes this.
  2. sean244


    Nov 4, 2017
    Have you found a fix for this?