Hey Guys,
I am making an animated door which I am going to scatter throughout a level
I am working on.
What I currently have is a prefab structured as follows:
door=empty game object
--doorMesh=model & anim
----trigger
And the code attached to my trigger this:
void OnTriggerStay (Collider info)
{
if(info.tag == "Player") {
if (Input.GetButtonDown("Fire2"))
{
//animation door open
GameObject.Find("cellDoor").animation.Play("Take 001");
}
}
}
As you can see, it only works if you have just one door. What is needed is a way
to reference the doorMesh a step above in the hierarchy.
Any help would be greatly appreciated