Make animator rules apply to multiple sprites without all sprites with animator being effected by conditions.

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); }
	}
}

The problem isn’t on the animator side it is in your script assuming this script is on all three enemies.

If it is on all enemies all enemies check if leftcontrol is down and if so switch to the dead state in their animator.

To test this theory remove this script if you can from all except one enemy and test again.