I want the behavior tree to randomly do one of the tasks below a selector. Don’t care which task.
My current solution is to randomly Finish Execute with a fail so it goes to the next one. It works but it doesn’t feel clean.
Is there a cleaner solution?
You can create a ‘Service’ and assign a random integer to a blackboard value and then on each task, use ‘blackboard condition’ decorator to check that integer value. Here, take a look at this very simple setup for a better understanding;
Assign the service value to blackboard value.
Note that in this approach, the selector only picks one random task to execute. Hope it help.