Transition from all substates in substate machine in mecanim

I have a substate machine that contains a series of idle animations (about 6 of them currently) that are randomly selected upon entering the idle substate machine by a simple substate machine behavoir script.

According to this : Having fun with the new Mecanim features | Unity Blog

I now want to transition from any of these states into a locomotion substate machine when the speed parameter is greater than zero.

I tried connected the ‘idle’ substate machine with the ‘locomotion’ substate machine in the layer above the idlesubstate machine using a transition with the condition of speed > 0.

However the idles just keep playing and the transition is never done.

How do I get any of the idle animations in the idle substate machine to be immediately interupted when speed >0 and transition into the locomotion state without selecting each on and creating a transition on each one through the (Up) Base Layer and into locomotion? Because this doesn’t seem a very good way to do it especially when I intend to expand the number of idle states in future.

The state machine system has some very, very strange desicions built into it.

Setting up a transition between two substate machines does not actually do anything on it’s own. You also have to use the entry/exit nodes.

So if you have a state machine transition from the substate machine Idle to the substate machine Locomotion, that will only kick off if the exit node in the Idle machine has been entered.

Sadly, there’s no possible way to set up a transition which means “from any state within this machine, transition to the exit node if the speed variable is greater than 0”, as the any state node within a state machine is the global any-state.

So as far as I’ve been able to work out, you have to have a damn transition out from every idle state. It’s a real pain.