- Home /
How to make a collision trigger thing?
Hello there everyone! I really need a script that like if you touch a cube it plays an animation. I've been working really hard to find one but can't find one. Cya!
Answer by shatley123 · Jul 07, 2013 at 12:37 AM
That's not specific enough to give your a complete script, but I would give the cube a tag, lets say "cube"
And use function OnCollisionEnter(collision : Collision) { if(collision.tag = "cube") { animation.Play() }
}
Pardon any minor errors, i haven't had time to check it in MonoDevelop.
Your answer
Follow this Question
Related Questions
Plane flyby triggering/help 1 Answer
Animate gameobject when collided with another gameobject using VRTK 0 Answers
A simple basic script: play animation on collision 0 Answers
How to have other (any) Objects smoothly push a Character Controller? 1 Answer
How to Play an animation state on an animator controller on collision? 1 Answer