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.
  2. Dismiss Notice

Animator has not been initialized

Discussion in 'Editor & General Support' started by Vire, Apr 23, 2013.

  1. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    Hi,

    Just curious why am I getting this warning?

    It stops things from working because I am trying to feed:

    Code (csharp):
    1.  
    2. anim = gameObject.GetComponent("Animator") as Animator;
    3. anim.SetFloat("Speed", v);
    4. anim.SetFloat("Direction", h);
    Into it. v is vertical input and h is horizontal input. But it wont work because the animator doesn't get updated with the speed / direction and it gives the warning (as found in the title) specifically on those lines.
     
  2. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    Ok weird, the speed works but direction doesn't.

    By "works" I don't mean it updates, but the animations based off speed works.
     
    Last edited: Apr 23, 2013
  3. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    If I Debug.Log the direction it shows that the float is being set yet my blend tree doesn't blend between those animations?

    Edit: I solved it, I create the directional animations by rotating the root joint that's added after baking, and I didn't have root transformations enabled.

    This thread is now about why my animator wont provide visual feedback as the game is playing.
     
    Last edited: Apr 23, 2013