How to stop animator state machine

Hello and Happy New Year! Let’s hope 2021 is better than 2020.

I’m using a StateMachineBehaviour on some attack animations to trigger things like hitboxes and effects. However, in the event that I want to interrupt theses to play another animation, such as a damage animation, I want the current behavior to stop. I thought that’s what Animator.StopPlayback() was for, but I was wrong. I also thought by playing another animation, that should prevent the current animation from completing/reaching the normalized time I use to trigger effects, etc., but I was wrong. The animations are even on seperate layers, but still the interrupted animation keeps going. How can I make sure the animation I want to interrupt has actually been stopped?

Things I’ve tried:
Checking if the AnimatorStateInfo.fullPathHash has changed
Checking if the layerIndex has changed

OK So I guess there is no way to do this?

Is there not a single person who uses the StateMachineBehaviour that can answer this?

Hello, I’m not sure I understand what you mean, do you have transition from “Attack” or “Any state” to “damage” state with 0 exit time?
I use similar approach, but i use animation events instead.