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

After SetGenericBinding(Animator) and remove them, the Animator become uninitialized for a while.

Discussion in 'Timeline' started by canis, Feb 2, 2021.

  1. canis

    canis

    Joined:
    Oct 25, 2013
    Posts:
    79
    As title, I was playing around the timeline and use it to override my animator at runtime,
    1. Assign the humanoid Animator to PlayableDirector
    2. wait until the playback finish.
    3. the PlayableDirector will remove that Animator by SetGenericBinding(null);
    4. ISSUE : the humanoid Animator become uninitialized. all the private variable being reset to default value.
    Right now I'm using hack to prevent system failure,
    to manual detect the Animator.isInitialized on Update,
    if the issue happen, re-init the whole system depend on Animator (costly).

    Q: but I would like to ask is that a way to prevent (4) happen ?!

    here is what I'm doing, setup the timeline on scene's obstacle and allow the designer to define the movement
    to get over it. and without mess the Animator on character.