Reset State Machine

Hi,

Is there any way I could reset a state machine so that it could start from it’s entry position again?

Imagine I have a two state machine for different weapons Sword and Club.
Whenever Sword start playing between each animation and I switch weapons to club so it blends into Club StateMachine, Sword StateMachine just stop and whenever I come back into Sword StateMachine again, it continue where it’s left off

I’ve been digging into the AnimNode_StateMachine source and I guess there could be something that could be done via FAnimNode_StateMachine::SetState, but since it got many call from the Out parameter FAnimationBaseContext, calling it directly would be a bad idea, skipping many important steps.

Is there any simpler way to do this?
Another option would be whenever I transition from one state machine to another state machine, rather than resetting into entry point, I could specify my entry point itself, so that each animation play nicely, this would be a feature request I suppose.

Thanks for the help!

bump, any information on this? or this is not supposed to be the way to approach this problem?

Hi ernesernesto,

You would not reset the state in the state machine per se, but you would tell the animation to reset in the state through the event graph once the player has left the state, similar to what is shown here:

As far as switching between the sword and club states, you would set up 1 montage containing both these animations then choose when to play one or both by setting up, in the event graph, when to play either or both notifies in the montage. Here is a sample set up:

66978-reset_notify.png