i have been trying to make an easy walk animation script. like final fantasy or most of the old school rpgs. or at least close to it.
function Update () {
if(Input.GetButtonDown("a")){
animation.Play("walk");
}
else if(Input.GetButtonUp("d")){
animation.Stop("walk");
}
else if(Input.GetButtonLeft("w")){
animation.Stop("walk");
}
else if(Input.GetButtonRight("s")){
animation.Stop("walk");
}
}
i have a simple walk animation. and my character mesh. but i am not sure how to add the script to it to make him animate and move?
my walk animation is called “walk” and my character mesh is “hero” if that helps?
update: here is the console error i get if i add my script to my character mesh.
UnityException: Input Button l is not setup.
To change the input settings use: Edit → Project Settings → Input
Walk.Update () (at Assets/models/hero/script/Walk.js:2)
update: i found the problem i was adding my FBX to my OBJ modal all i needed was the FBX file what a noob i am lol! thinks guys for all your help!