Im doing something wrong/isnt codeing right please help me with the script=)
function Update ()
{
if (Input.GetAxis (“Vertical”))
animation.CrossFade (“run”);
else animation.CrossFade (“idle”);
if (Input.GetAxis (“Horizontal”))
animation.CrossFade (“run”);
else
animation.CrossFade (“idle”);
}
what is exactly the problem do you have?, the player don´t move or moves badly?
you can try using || :
function Update () {
if (Input.GetAxis("Vertical") || Input.GetAxis("Horizontal"))
animation.CrossFade("run");
else
animation.CrossFade("idle");
zine92
July 31, 2011, 1:24am
3
Have you attach an animation component onto your object? Is there some sort of error or just the codes not working. I think the one posted above me should work. If not check your animation.