Question by
importguru88 · Mar 05, 2016 at 03:54 PM ·
animationjavascriptaienemy
Idle , Move and Attack animations
I want the enemy to idle , follow , and attack the player . The thing is I want the enemy to use it's move animation when following the player , and use the attack animation when the player is in distance , and ldle back when the player is dead . I am having some problems. Here is my java script :
var other : Transform;
function Start () {
}
function Update () { var distance = Vector3.Distance(transform.position, other.transform.position); GetComponent.Animation.Play("attack");
}
Comment
Your answer
Follow this Question
Related Questions
Enemy is not taking damage! 0 Answers
How to enemy animation attack player 0 Answers
I need the Nav Mesh Stop , I need the Animation to Play Javascript 0 Answers
Enemy Animation Play 0 Answers