Animation wont stop!

Hello,

i have this animation where the character draws a sword and one where he puts it away.
but they keep playing?!
when i start the game up it puts the sword back on his back nice and smooth but when i draw it again(enter combat state) it loops but very unsmooth (it has no loop frame) and when i put it back the same happens.
hope you can help me :slight_smile:

the code:

function Update () {

if(PlayerStates.currentState == CharStates.normal){

if(swordDraw == true){
swordDraw = false;
SwordDraw();
}
else if(PlayerStates.currentState == CharStates.combat){
if(swordDraw == false){
swordDraw = true;
SwordShede();
}

its in an Update function, this is called every frame. could you post the whole script and i can show you a simple fix

Simply switch to an idle animation?

Or you could just stop it:

// Stop the walk animation
animation.Stop("walk");

USE THIS A LOT IT HELPS

animation.Play("your animation", Playmode.StopAll);

it basically starts the other animation and at the same time stops all other animations that the object is running