Character Looping Walk and Idle

Hi !! i ask something … my character didn’t walk continuously i cannot find the looping … where i find it also the idle … please … help me … Thank you so much … for advance :slight_smile:

click on the animation in the project view and when you do that you will see settings for the animation and you can set it to loop from there :slight_smile:

or if you want to loop a animation by script do the following:

function Start (){

   Player.animation["DefaultAnim"].wrapMode = WrapMode.Loop; 

}

this is how you set the animation to loop when the game starts. Now where it says “DefaultAnim” you need to look for you animations name and then put that there.

Now if you want to call an animation just do the following :

function Update (){

   if(Input.GetKey(KeyCode.W)){

          animation.CrossFade("DefaultAnim", 0.2); 

}

else{

   animation.CrossFade("Idle");

}
}

that is how you play an animation with the press of a key. basically all this does is it plays your animation when you press the W key when you let go it goes fading back into the Idle animation :slight_smile:

hope this helps :slight_smile: