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?