can some onehelp me with this code(Js). (No Errors).

var ObjectToAnimate : GameObject;
var TheAnimation : AnimationClip;

function OnTriggerEnter (hitPlayer : Collider) {
if(hitPlayer.gameObject.tag == "Gold Cube") {
	
	ObjectToAnimate.animation.Play("TheAnimation");
}
}

its spose to animate the object you drag into it but you can select the animation but when i get it all set up nothing even happens can somone please help thanks in advance

Try changing “TheAnimation” to TheAnimation.name (no quotes)