OnStateMachineEnter and OnStateExit calling order

when state ‘a’ transits to statemachine ‘b’ ,
log shows like this order

  1. b: OnStateMachineEnter
  2. a:OnStateExit

is this intended by design?

Yip. If you click on the transition a->b in the Animator graph and look at it in the inspector, you’ll probably see that it involves two overlapping states, which accounts for this order of method calls.