Guys, I really don’t know what to do with this one.
I have an object, with 3 animation clips set up in the animator.
They are triggered by 2 parameters, which I control from my script, and they work really well, but the only problem is that the animation plays for all the instances of that object at the same time.
The script I use is this one:
private var animator : Animator;
static var jump: boolean = false;
static var attack: boolean = false;
function Awake ()
{
animator = GetComponentInChildren(Animator);
}
function LateUpdate()
{
animator.SetBool("Jump",jump);
animator.SetBool("Attack",attack);
}
And the two static variables I set in other scripts.
The problem is that I get the animator component from that specific instance, and the parameters are set to all of them.
Anyone with a clue?