Hello everyone,
I encountered something that looks like a bug to me but maybe I missed something.
I wanted to submit the problem before doing a bug report.
The problem seems to be that when computing the transition from a sub-state machine to another, if a default transition is selected, then all following transitions will be the default one in the nested sub-state machines.
It’s a bit complicated to explain (especially in another language ;-p) so I made this image :
Referring to this image, imagine the character plays Spell_146, it then has to determine where to go next at the exit node. The controller is setup so that it should play “IdleAttack1_W01” in the sub-state machine “OFFENSE” nested inside the sub-state machine “IDLE” (follow the green transition lines).
When evaluating where it should go in the “IDLE” sub-state machine, it rightfully choose to go to “OFFENSE” which is the default state because the condition needed to go to the “DEFENSE” sub-state machine is not true.
But from there, it just choose to play “IdleAttack1_W00” because it’s the default transition, even if the condition to go to “IdleAttack1_W01” is true (it doesn’t follow the green line there).
To solve this, I put a transition in addition to the default transition from the entry node of “IDLE” into “OFFENSE” with a condition (the opposite of the condition on the entry->DEFENSE condition). You can see the three orange arrows on the transition on the image.
My guess is that because it didn’t chose the default transition in “IDLE”, Mecanim now correctly chooses the transition in “OFFENSE”.
I hope I explained myself clearly enough.
Thanks in advance ![]()
PS. This is in 5.1.2p1 but I’ve been having this problem for a while so it’s not a recent regression, it’s probably always been like this). I just happened to find why.
