Blending out of a sub state from any clip

Hi there,

I’m a bit stuck on this, I have a sub state machine and I’d like to transition out of it regardless of the clip it’s currently playing.

Here is the sub state machine -

It could be at either of these clips.

I am not sure if I am misunderstanding sub states, but if you have to make every transition out individually, what is the point of them? Are they there just to clean up the view?

Thanks,
Pete

I just did this about a month ago but memory is vague because I was only prototyping.
Can you show your sub-state?

First - what are you using the sub-state for, what purpose does it have for your specific system?

I was using it as a randomizer for idle animations, and I think I set one state to be the entry/exit state. Upon clicking the animation would transition into the entry/exit state within the sub-state and then instantly transition into one of the 4-6 random idle animations until I clicked a move button which would return the idle back to the entry/exit state and transition out of the sub-state into the walk/run.
As I type this - it doesn’t sound exactly correct - but that might help you trouble shoot your setup.

Hey thanks!
I was trying to do a similar thing to that.
I ended up making a blend state with a lot of blend target and on entry to that state I’d move the blend float to the appropriate spot for that clip. Felt a bit hacky but it worked. I was just worried that loading up a blendstate might have a bit of an overhead…
This is what I had but with about 20 possible blends.

I see what you are suggesting though and that seems like it would work, I might have another try.
I think it would be ace if you could just blend out from anywhere in a substate.
I sorta feel that I’m fighting against mechanim a lot so I’ve started putting together a bit of a doc while working on this project and hopefully I end up with something useful to send the devs at the end.

Found it. :slight_smile: This was the video I was loosely following when I was prototyping a sub-state.
Hope it helps a little.

https://www.youtube.com/watch?v=_Mv6tFKbKvI

I know the feeling, but it really ‘helps’ with set up when you finally gain a hold of it for your particular needs, and imo is very versatile for nearly any type of animation system we can come up with.

Awesome, thanks so much for that! I’ll check it out now.
P.

1 Like

Hey thanks man that’s working great now!
Here’s the blocg post in case anyone else needs it - Unity Blog

Just wondering, is there a way to copy/paste transitions?

Thanks!
Pete

1 Like

There’s no built-in way. You can create an editor script that allows you to do it, though.

Ahh bummer, I’m not that experienced with editor scripts.
It’d be nice to see some of this stuff in future versions. I feel as though mechanim misses out on some things that would make experimentation (and the whole process) a lot easier.

Thanks though!
Pete