How to get AI to wait until something is true?

Hello,

I am creating an AI customer for a store management game where the AI walks around, grabs some items, and goes to a register, purchases and leaves. I am trying to strengthen the code for the customers in line where the one that is first in line waits until an employee is at the register but don’t really know how to go about it.

In the behavior tree after it has arrived at the register and adds it to the register’s array of customers in line, I need it to check if an employee is present, ie. just a variable in the register that is set to true if an actor with a certain gameplay tag is in the collision box. However, if there is no employee, then I need the customer to wait until there is an employee present to then continue on with the rest of the behavior tree tasks.

I guess you need to use task “wait” Behavior Tree Node Reference: Tasks | Unreal Engine Documentation
also, you need to create such a boolean variable for blackboard, I don’t remember how to do it exactly