How to stop mecanim transition

Hi guys,

When my character lands on the ground after a jump I’m using animator.Play command to fire the “land” animation. Most of the times works fine, excepting when my character is in the middle of a transition. If that happens, animator.Play command doesn’t work instantly, but waits to finish the transition first.

I’m unable to find any command that forces the transition to be stopped. Does anyone know if it exists or if there’s a way to avoid waiting for it to finish?

Thanks

Well, I need that transition to have the “has exit time” property checked to work properly.

The thing is, is there any way to interrupt by code a “has exit time” transition in order to play a different animation?

I’m not a code guy - just an animator, so feedback might be only half relevant.

The ‘has exit time’ option allows transitions to be locked so they are not interrupted OR allows them to also ‘be’ interruptible - so this is the answer you seek, however I’m not sure what code snippit is needed.
Maybe this?

Alternately - consider what transition is happening when the character should be landing.

Isn’t the character performing a falling animation before he should be transitioning into landing?

What transition is the character ‘sometimes’ in when the landing animation ‘should’ be triggering? Maybe there is an alternate setup which removes the possibility of any transitions happening when the character should be landing.