-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to return to the previous sub-state of a Hierarchical FSM? (2.0) #28
Comments
Hi @tomsseisums, Thanks a lot for providing a real-world example with your issue. This really helps me understand the problem and also the way that UnityHFSM is being used. This is a use-case I had not considered before, so there is no time-saving way to achieve this automatically. But it should be possible with the existing functionality. What you want to do is to start in the last state that the state machine was in. An idea that comes to my mind is to simply set the start state when the state machine exits. There are two ways to achieve this (please keep in mind, that I have not tested the example code yet):
In any case, I think that this is a useful feature that I want to add to UnityHFSM. As I'm quite close to releasing 2.0, I'm going to add it to the next release (2.1), probably implementing it directly in the Let me know if this works. |
This implements the new feature requested in #28.
Hi @tomsseismus, |
I'm already using/evaluating 2.0 WIP version, hence you can see ExitTriggerTransitions
I have a fairly simple game, which I can easily model as a multi-level Hierarchical FSM.
But there is one caveat, exiting sub-state completely resets it, and there is no way to enter back to a state it was previously in:
menuFSM
was before it exited: LEVEL_SELECTION.Any way to do it with existing functionality?
The text was updated successfully, but these errors were encountered: