0
Answered

Unit that kills parallel FSMs in the same graph?

NeedsLoomis 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 5

Since Bolt allows multiple start points, I was wondering if there is a unit that stops parallel FSMs, to prevent conflicts when you need to.

Also wondering if there is a "Global" (as the competitor calls it) or super transition that overrides all other transitions and leaps the current state across the FSM to it.  For instance, you could have an event (like if the player dies) that jumps the FSM back to Start.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Pending Review

To answer your question, at the moment, there is no "kill state machine" unit nor a "global" transition type.

Now of course, if there is a design you can't implement because of this, I'm willing to consider implementing a similar feature, but there are dozens of ways to go about this. In my experience with FSMs, "Any" states often indicate a bad state design and provide a hacky way out of it. 

Can you give me an example of what you're trying to do?

Sure. Im testing camera controls through an FSM.  Each state corresponds to a waypoint.  At some points in the game there are choices that might branch into a few different directions.  I was doing this through code pretty simply, but figured it would be nice to chart out the possibilities visually.  

I noticed there are certain cases where I might want to restart, but Im not sure the best way to go about doing that.

+1

Hm, a simple way to restart at the moment would be to disable and re-enable your state machine. Disabling exits any active state or transition, and enabling enters the start state(s).

I could add utility Restart method that does basically this behind the scenes in a future version.

Thats an easy enough work around, thanks :)