- Home /
Question by
Bootsgaloore · Sep 06, 2012 at 11:17 AM ·
animationusemore
Script for playing animation?
Hello I have this script and i want this script to be used for more then one animation
var Clip : AnimationClip;
function OnTriggerEnter(other : Collider)
{ if(other.gameObject.tag ==
"Player")
{ animation.Play(""); }
}
Please help
Thanks
Comment
Please provide an explicit title. For example: "Script for playing animation" would be slightly better.
Best Answer
Answer by goo-muffin · Sep 06, 2012 at 11:22 AM
var Clip : AnimationClip; <--- You don't need this
function OnTriggerEnter(other : Collider) { if(other.gameObject.tag == "Player") { animation.Play("Here just write in the name of the animation you dragged on the gameobject before"); } }
This is everything not so difficult
and i can use more then one animation with this script
look at while or for... and arrays this would be more complex
Your answer
![](https://koobas.hobune.stream/wayback/20220613080711im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Animation play on input, else play idle animation. 2 Answers
Controlling Animation ON TOUCH 0 Answers
Respawn script and door animation help 0 Answers
Way to have mulitple input? 1 Answer
play animation when moving,and idle animation when stand still 1 Answer