Trigger an Animation from Another Object.

I am trying to trigger an animation from another object.

here is my script code.

void OnTriggerStay(Collider col)
	{

					if (Input.GetKeyDown (triggerKey))
					{
						//animatingObject.GetComponent<Animator>().SetTrigger (animatingObjectAnimation);
						animatingObject.animation.Play (animatingObjectAnimation);
					}
				}

My debug log when I hit the triggerKey says:
The animation state Use_Switch could not be played because it couldn’t be found!
Please attach an animation clip with the name ‘Use_Switch’ or call this function only for existing animations.
UnityEngine.Animation:Play(String)

can anyone please help?

Put this at the top of your code. Oh I code in c#.

public Animator animator;

Then assign the outside animation component you wish to play.

Then its just:

void OnTriggerStay(Collider col)
{
if (Input.GetKeyDown (triggerKey))
{
animation.Play();
}
}