Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Animator Freezing First Frame

Discussion in 'Animation' started by DominicHarrisStudio, Jan 28, 2019.

  1. DominicHarrisStudio

    DominicHarrisStudio

    Joined:
    May 1, 2015
    Posts:
    4
    Hi.

    I have two characters with two separate but similar animators.
    They both share the same logic scripts and each have over 1000 separate animation clips.

    As of recent, one of the two characters is getting stuck on it's idle loop anywhere between 3 - 7 hours of runtime.

    How the animator works:
    Every 3 minutes, I use "animator.Rebind();" to reset the character back to the beginning.
    The very first state is an "empty state" where it sits until its meets the correct parameters that certain "any states" are asking for. The any state has a transition to the correct idle loop. The idle loop contains many behaviours such as a behaviour that prevents the any state from firing a second time.

    The character does own props which are seperate gameObjects with their own animator. Certain character animations have behaviours that play specific animator states on the prop. These props do indeed get enabled and disabled but the issue is not apparent on them.

    When it gets stuck
    I have not been able to find a cause but i believe it is around the time when I rebind. The rebind still works, the character gets reset, and the character chooses the correct any state again.
    When the character arrives at the correct idle loop, the behaviours all fire. The character does not perform the second frame of the animation and is stuck is a paused-like state.
    I have scripts that set variables on the animator and they continue to work as I can see the animator updating correctly in the editor. So it is not like the animator totally freezes.

    Have you any ideas what might have caused this?

    I have found a post that describes a similiar problem - https://forum.unity.com/threads/losing-animator-state.307667/
    i am not disabling and re-enabling the character

    I am using Unity version 2018.2.16f1
    I have also tried upgrading to 2018.3.0f2 with no success.

    Thanks
     
    Last edited: Jan 28, 2019
  2. DominicHarrisStudio

    DominicHarrisStudio

    Joined:
    May 1, 2015
    Posts:
    4
    I use the puppet master plugin and blend weights dynamically based on the animation. This process is quite heavy.
    I improved the performance of the code which seemed to rectify the problem.
    It seems that the animator just struggles to keep up.
     
  3. DominicHarrisStudio

    DominicHarrisStudio

    Joined:
    May 1, 2015
    Posts:
    4
    I had a rouge logic that ran on a behaviour on a single animation state that setting values that didint exist and was breaking the animator.