How to run a specific branch of behavior tree?

Hello!

I’m using behavior tree for the first time and I was wondering what the best way of choosing a specific branch. For instance, lets say I have one selector that has 3 children : Working, Eating, Bathroom. If I wanted working to eventually start executing bathroom, what’s the best way of doing it? Is there an easier way than just having decorators check if a key is equal to certain value? Can I not just say execute the sequence that is named bathroom?

Thanks!

I just started using BTs too and so far, the usual solution i see is that, decorators to use BT as a state machine, and i think it cant become easier than that. Decorators and Notify Observer are your friends, i use it as switches. Set up a task to change the Enum and that will let you switch between branches easily.

1 Like