When i attach this script to multiple units only 1 of them is animating whats the problem here? need some help plz

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;

public class Skeleton_Enemy_Script : MonoBehaviour {

public Transform player;
static Animator anim;

// Use this for initialization
void Start () 
{
	anim = GetComponent<Animator> ();	
}

// Update is called once per frame
void Update ()
{
	if (Vector3.Distance (player.position, this.transform.position) < 20) { // Detect Player Range
		Vector3 direction = player.position - this.transform.position;
		direction.y = 0;

		this.transform.rotation = Quaternion.Slerp (this.transform.rotation,
			Quaternion.LookRotation (direction), 1f);

		anim.SetBool ("isIdle", false);
		if (direction.magnitude > 2) { // How Close To Target
			this.transform.Translate (0, 0, 0.8f);	// Run Speed
			anim.SetBool ("isWalking", true);
			anim.SetBool ("isAttacking", false);
		} else {
			anim.SetBool ("isAttacking", true);
			anim.SetBool ("isWalking", false);
		}
	}
	else
	{
		anim.SetBool ("isIdle", true);
		anim.SetBool ("isWalking", false);
		anim.SetBool ("isAttacking", false);
	}
}

}

Thy all play idle animation but only 1 of them uses walk and attack the others stay in idle animation