- Home /
Question by
Ty1ensen · Jan 14, 2014 at 01:45 AM ·
animationontriggerenter
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
Comment
Answer by getyour411 · Jan 14, 2014 at 01:57 AM
Try changing "TheAnimation" to TheAnimation.name (no quotes)
Your answer
Follow this Question
Related Questions
Play animation OnTriggerEnter (C#) 1 Answer
Door animation 1 Answer
Can the animation editor create local rotational data? 3 Answers
Using weapon switching script makes any weapons with animations disappear 2 Answers
Adding animation clips via script 2 Answers