- Home /
Animation triggered by an animation?
Hey, I'm working on a simple first person horror game. I have a house with stairs and upstairs area. I want Slender1 to go up the stairs on the box collider and trigger Slender2 animation.Please help I'm new to scripting and I have no idea what I'm doing lol.
Answer by bman85 · Oct 28, 2013 at 03:46 AM
var triggerAnim : boolean;
function OnTriggerEnter (other : Collider){ if(GameObject.FindWithTag("nameofobject"){ triggerAnim = true; } }
function OnTriggerExit (other : Collider){ if(GameObject.FindWithTag("nameofobject"){ triggerAnim = false; } }
function Update (){ if(triggerAnim){ Animation.Play("nameofanimation"); } }
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Why won't it run 1 Answer
How do i make a text box appear on screen after a chest has been opened? 3 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
problem with weapon animation -.- 0 Answers