Question by
importguru88 · Feb 26, 2016 at 05:21 PM ·
animationerroranimatoranimationclipenemy ai
Error no animation attach to bear
Getting some errors . When I click on play ' the project will go to play and pause and it will stay on play and pause. Errors are saying I don't have any animation attach to the gameobject bear. What I am trying to do is get the gameobject bear to follow when the player enter the box collider using the move animation, attack the player when is near the player using the attack animation , and idle back when the player is dead. Help would be appreciated.
function Start() {
anim = GetComponent.<Animation>();
GetComponent.<Animation>().wrapMode = WrapMode.Loop;
target = GameObject.FindWithTag("Player").transform;
} var target : Transform; var attack : AnimationClip; var move : AnimationClip; var idle2 : AnimationClip; var bear : GameObject; var attackThreshold = 3;
function OnTriggerEnter() {
GetComponent.<Animation>().Play ("attack");
GetComponent.<Animation>().Play ("move");
}
function Update () {
GetComponent.().CrossFade("attack");
GetComponent.().CrossFade("idle2");
}
errors.png
(131.1 kB)
components.png
(200.1 kB)
Comment