Search Unity

UI Animation resets

Discussion in 'Animation' started by the_lemur, Aug 20, 2015.

  1. the_lemur

    the_lemur

    Joined:
    Apr 3, 2013
    Posts:
    104
    I have a simple animation on my HUD that animates it on and offscreen.

    The animator has two states.

    Onscreen and Offscreen.
    Setting parameter "onscreen" to true makes Onscreen->Offscreen and plays an animation that has the HUD come down from the top.
    Setting onscreen to false, plays the animation in reverse and the HUD goes up the top of the screen.

    This all works and i can toggle it back and forth.

    but if I click a main menu button in my game, it loads the main menu. then when i begin the game again, the HUD is stuck offscreen.

    The STATE says Onscreen, but it's really offscreen coordinates.. even though both the prefab and the object in the scene are onscreen.

    using the animator to get more information on what's going on seems really hard.
     
  2. the_lemur

    the_lemur

    Joined:
    Apr 3, 2013
    Posts:
    104
    Okay this was all me.

    some combination of setting the time.timeScale to 0 when the game was paused for the pause menu,
    plus keeping a static stack of all open menus and forgetting to clear it on level change.