Hi I implemented a 3D Char into my Unity project and finally managed to get the animations playing, however the run animation just play once as soon as I press the forward button.
What I want is that as long as the forward Button is being pressed the animation should play and not just once.
Can someone help me with this ?!
var walking = false;
function Update () {
if (Input.GetAxis(“Horizontal”) > 0.2 && !walking) {
animation.CrossFade ("walk");
walking = true;
}
if (Input.GetAxis("Horizontal") <= 0.2 && walking) {
animation.CrossFade ("idle");
walking = false;
}