Search Unity

[Solved] Are StateMachineBehaviours unique to each GameObject?

Discussion in 'Animation' started by Deleted User, Apr 14, 2017.

  1. Deleted User

    Deleted User

    Guest

    Or do GameObjects using the AnimatorController all share the Behaviours?

    if I have something like this:

    Code (CSharp):
    1. private SpriteRenderer _myCachedVariable;
    2.  
    3. public override OnStateEnter(Animator animator, ...){
    4. _myCachedVariable = animator.GetComponent<SpriteRenderer>();
    5. }
    Will _myCachedVariable be overriden everytime a GameObject enters the state or will each GO get their own cached variable?
     
  2. mikael_juhala

    mikael_juhala

    Joined:
    Mar 9, 2015
    Posts:
    247