State ReEntry

LordConsecro 2 years ago updated by Lazlo Bonin (Lead Developer) 7 months ago 3

Ability to reenter an already active state. Very useful when implementing anystates, because sometimes the state doesn't exit before being called again. 

For example;

Lets say I have an anystate with 3 nodes. One laugh, one cry, and one yell. Now if I trigger the laugh, then cry then go back to laugh it all works perfect. But what if I wanted to make them laugh, but then wanted to make them laugh again. It wouldn't fire because the laugh node is already active. So I have to create a lot of extra transitions to make sure ALL nodes attached to an anystate are left if there is a chance of them firing again.

Hope that made sense.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Under Review

Hi LordConsecro! Thanks for logging the idea, really helps us keep track.

If I understand correctly, the "Re-enter States" option should be on the Any State itself, not on each individual state, correct?

We'll be reworking Any State for Bolt 2 anyway (to recursively exit all branching states, not just the directly connected ones), so it seems like a good moment to add this feature in.

I was thinking more of individual states. With Any States becoming recursively exiting I would suggest you make exiting of other states a toggle. This would make reentry on individual states very useful. This is currently how I do my AI logic, Dialogue logic, etc. Sometimes I want states to be able to fire more than once, sometimes only once, and sometimes I don't want them to be able to get to a state until multiple prior states have been entered. Hope I made some kind of sense. If you want I can post a graph showing some of my logic, and how with re-entry it would immensely clean them up.


(Sorry for the bump/necro, I'm doing some roadmap grooming following the Unity acquisition!)

This is now supported in the latest Bolt 2 Alpha. States now have a "Re-Enter" checkbox in their inspector.