Transition from all states inside sub-state machine

Hi, I’ve been refactoring my complex animator controller recently, and faced some problems using sub-state machine.

Here’s my example screenshot :

I just need to come and go between “Fall” and “GroundMotions” substatemachines, with ‘grounded’ bool condition. Whatever state is playing inside sub state machine, when condition is right I want to cancel it and transit between each other.

But, to do this, it seems like I have to add transitions for ALL states inside each substatemachine…

I know there’s “Any State” feature, but there’s no substatemachine specific “Any State” yet.

So, are there no options other than just use Animator.Play in onStateUpdate()?

Thanks for your answer in advance!

3 Likes

That would be so nice. Sadly, no can do without scripting.

1 Like

Thanks for the answer. Wow, well, that’s…so…sad… :frowning:

1 Like

Have you try with Entry and Exit state?

At least with entry and exit node when you add a new state you don’t need to add a transition for all possible permutation

They’re already using the exit/entry nodes (see the screenshot, the arrow’s gray, which indicates a machine transition).

ah true, I didn’t spot it the first time

So what do you think about an “any internal state” node, which works like the any-state node, but only as long as you’re inside of the substatemachine the node’s in?

Setups like @GarlicDipping 's, where you want to exit a machine no matter where you’re in it, are pretty common. an Any Internal State node would help a lot. It’d also reduce the number of transitions and make the state machines much more appealing and readable.

6 Likes

Yup, as @Baste says, ‘Any internal state’ node will be really helpful. I found there’s already feedback here, but seems like it’s not on the spotlight yet…

1 Like

OMG @Mecanim-Dev plz implement it guys!

It’s needed, and would improve the mecanim workflow a lot, its usability is very high

4 Likes

yup, this feature would be extremely handy

5 Likes

I agree, - even though it would mean having to check more outgoing transitions, to see what the user intended to do. Who cares, just do it guys!! it will be amazing

Would still love to have this. Hopefully it gets added.

1 Like

no more updates? we need this feature so much.

1 Like

Heh…Jumping onto this bandwagon too. A node for ‘Any internal state’ would be beautiful.

Just saw this thread when I was googling. Have so many situations like this in my game. Currently, I am calling Play/CrossFade on the animator in the player controller’s state machine (not the Mecanim one). It would be very neat to have some default state within a sub-state machine that you can transition to.

+1 for “any internal state”.
I need to exit to parent state from all of these.
6736336--775867--upload_2021-1-18_18-28-41.png

1 Like

Is the Unity team aware of this? Would be really useful.

Right now the only way to do something similar is to add a transition out of the global Any State node, which doesn’t always fit with what one wants to do, or adding transitions from each sub state machine node to the Exit node.

3 Likes

I’m in the same situation. It feels ridiculous Unity has been aware of this since 2016, and you have still to do a one-by-one transition when working with sub-state machines.

1 Like

I’d really appreciate this feature as well.

3 Likes

Agreed, this would be very very useful