I would do something along those lines:
void OnCollisionExit(Collision other)
{
if(other.CompareTag("platform") && !animation.IsPlaying("Lionjump"))
{
isGrounded = false;
animation.Play("Lionfall");
}
}
This should work as the code I added reads if the animtion called ("i dont know") is NOT playing than do this.
Now you might need to modify the name of the animation and you would have to reference the animation at the start of your script but either than that from what you have said this method should work. I havent tested it so, just leave a comment if you have any issues
↧