Hi everyone. I’ve been trying to get a specific animation to play when the player presses w, a, s or d. Whenever I press w, a, s or d though, nothing happens. This is what I have already. Could anyone tell me what’s wrong?
var ForwardAnimation : Animation;
var BackwardAnimation : Animation;
var RightAnimation : Animation;
var LeftAnimation : Animation;
function Start () {
}
function Update () {
if (Input.GetButtonDown ("w")){
animation.Play("ForwardAnimation");
}
if (Input.GetButtonDown ("s")){
animation.Play("BackwardAnimation");
}
if (Input.GetButtonDown ("d")){
animation.Play("RightAnimation");
}
if (Input.GetButtonDown ("a")){
animation.Play("LeftAnimation");
}
}