The title should explain my title fairly well, but to elaborate…
I’ve got three enemies with the same animator and animations. There’s a boolean in my animator for ‘dead’ that turns on when the enemy dies. It works as you’d expect, but when one enemy dies, every one of them gets the death animation. How would I go about making each of the objects have their own animations and conditions without creating 3 separate animators? That seems a bit overkill, especially considering the enemy is a prefab I’ll need to instantiate multiple times.
My code, but I’m not sure the problem lies here, I think its more so something I need to do in Unity.
using UnityEngine;
using System.Collections;
public class ZEnemyLifeScript : MonoBehaviour {
private Animator anim;
void Start () {
anim = GetComponent<Animator>();
}
void Update () {
if ( Input.GetKeyDown(KeyCode.LeftControl) == true ) { anim.SetBool("dead", true); }
}
}