Animation not working when more than one instance of the prefab is in scene, only 1 of the objects animates.

There are 2 scripts involved. One is attached to the main parent (which is a aeroplane) the second is attached a couple of children levels lower on a gear object.
when the Current Altitude hits X the function on the second script is called to play the animation.
again, this works fine if only one prefab is in the scene. more than one then its not so fine.
Ive not used any static variables anywhere so that shouldbt be the issue.
Totally at a loss now, wasted the day - any help would be great.

sample of the code, which works fine if only one prefab exists in the scene.

private void Start()
{
	anim = this.gameObject.GetComponent<Animator>();
	TakeOffAlt = FindObjectOfType<AI_MQ9>().TakeOffAlt;
}

private void Update()
{
	if (FindObjectOfType<AI_MQ9>().CurrentAlt > TakeOffAlt 
		&& geardone == false)
	{
		GearUp();
		geardone = true;
	}
}

public void GearUp()
{
	if (geardone == false)
	{
		anim.Play("GearUp");
		GearUpSound.Play();
		Debug.Log("Gear Up " + name);
	}
}

I was thinking along those lines, hoped it wasnt a setting with it being quite new to me so… anyways, what ive done to fix it for now it just calculate the Current Alt in the same script that is attached to the gears and not reference the main script CurrentAlt with FindObjectOfType - this appears to work.

cheers for that. PS anybody else who see’s this, there are a few different ways to reference objects whilst there are multiple instances, check anyone of those out will help if you encounter the same kind of issue (i will be tomorrow :slight_smile: ! )
void SetAlt()
{
CurrentAlt = (int)(transform.position.y / 3.28084f);
}