Download

Reset State Machine on exit

I’ve discovered that when a State Machine stops being active, it “rests” in whatever state it was currently in when we left it

i.e. When blending between the output of two state machines in the Anim Graph; once the second State Machine goes fully blended, the first state machine does not respond to any underlying changes until it gets blend weight again.

The problem with this is that I want the graph’s states to reset while it is not active; the State Machine goes inactive from many states to transition to the special state machine which controls “hit reactions”; hit reactions will always end in an idle state. So I want to come back into the first State Machine from the Entry node. However, I cannot do this; if I’m in a state, once the machine goes active again, I must work my way through all the necessary transitions from this state back to the idle state. This cannot be done in the background while the other state machine is active… which is irritating.

So what I’d like is a way to either (a) tell a State machine to continue moving between states based on variables even when it isn’t otherwise being evaluated, or (b) a way to FORCE a State machine to immediately enter a given state and evaluate from there, to skip all other transition rules that might exist within it.

Did you have any solution to this? I want to have this kind of functionality too, I’ve been reading the source of AnimNode_StateMachine, hoping to find some way to force the animation state into entry node again but to no avail.
There could probably some way which involve void FAnimNode_StateMachine::SetState but I’m still not sure on how to do this

The (b) solution from RhythmScript would also be a viable option rather than forcing it to start again from entry node

Is there any way we could reach unreal dev about this problems to clear things up?

sorry for bump, I’ve made questions on answerhub and hoping someone on epic could shed some light
https://answers.unrealengine.com/questions/262870/reset-state-machine.html