How to use !animation.Playing to trigger movement?

Hey guys, I have it so that my enemy moves over during his jump animation, but I cant get him to stop when the animation stops, is this script right?

  if(animation.IsPlaying("JumpBack")){
MoveSide = 3;
}

else if(!animation.IsPlaying("JumpBack")){
MoveSide = 0;
}
}

the moveside is a number var basically the moveSpeed var. What am I doing wrong here?

It depends if your animations is set to loop, clamp forever, clam, default or once.

You’ll want your animation set to Once for its wrapMode.

Without the rest of your script I can’t really help much. Also try turing on the inspector debug mode and look at the animations component to see if the animation ever starts or stops playing.