- Home /
Trigger an animation
Hello! I am working on my own horror game atm, and I need some help. I created a small halway and a little room in the end of the hallway. I want the character to go down the hallway and on 1 spot I want a teddybear to be thrown out of the room. I have created the animation but I don't know how to trigger an animation. I know how to trigger pictures and soundes, but not animations. Do I need any scripts or anything ? Please answer fast ! :) thanks! (sry for bad english)
Answer by Chronos-L · Jan 05, 2013 at 08:11 AM
Put a trigger object on that one spot, attached this script
var teddyBear : GameObject;
function OnTriggerEnter (other : Collider) {
//If there is only one animation for the teddy-bear
teddyBear.animation.Play();
//You want to play a specific clip: thrown
teddyBear.animation.Play("thrown");
}
Your answer
Follow this Question
Related Questions
Animation end trigger 1 Answer
play a door animation with collider 1 Answer
Randomly spawn a trigger area 1 Answer
animation play in game over 1 Answer
Have game objectives appear on screen? 0 Answers