function Start () {
animation.Play();
}
function Update () {
if (Input.GetAxis ("Horizontal") < 0) {
animation.Play("walkL");
}
else if (Input.GetAxis ("Horizontal") > 0) {
animation.Play("walkR");
}
if (Input.GetAxis ("Vertical") < 0) {
animation.Play("walkB");
}
else if (Input.GetAxis ("Vertical") > 0) {
animation.Play("walkF");
}
}
This is an animation code for my character. I think it’s obvious what I’m trying to do, (Animate WASD movement) but I keep getting errors and my character doesn’t animate.
The animation state walkF could not be played because it couldn’t be found! Please attach an animation clip with the name ‘walkF’ or call this function only for existing animations.
UnityEngine.Animation:Play(String) scriptRockanoidAnimate:Update()
(at Assets/scriptRockanoidAnimate.js:16)
Also this error:
Default clip could not be found in attached animations list.
UnityEngine.Animation:Play()
scriptRockanoidAnimate:Start()
(at Assets/scriptRockanoidAnimate.js:2)