Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Animator always restart and return to default state

Discussion in 'Animation' started by daiyukun2013, Jul 26, 2021.

  1. daiyukun2013


    Mar 19, 2021
    Here is a very simple animator state machine I have(see the attached image), it just show and hide a slider submenu in the canvas:
    at start: showSubWindow=true: New State -> SubWindow_ShowAni
    showSubWindow=false: SubWindow_ShowAni -> SubWindow_HideAni
    showSubWindow=true: SubWindow_HideAni -> SubWindow_ShowAni

    after this it just loop between SubWindow_HideAni and SubWindow_ShowAni states

    My problem is, when sometime I want to show a model, after click the button to show the model and hide the submenu(showSubWindow=false), the animator is restarted and back to Default "New State", that means the submenu just stay there even I click the hide button(since the value is "false" it can't trigger animation), I can confirm the property value IS changed but it is the animator that crash and back to the initial state.

    It is really hard to reproduce it, since if I use other smaller model, it works totally fine, just in some cases(like big model), it reset the animator for no reason. I really hope if anyone has similar issue before, and thanks for any help to solve this problem.

    Attached Files:

    Kordi1 likes this.