Download

Moving to Empty Boxplot

Hi,

I am trying to make an npc move to a box trigger as long as there are no other npc’s of that class in there. I’m not sure how to do this.
Any help is much appreciated!

You need to create a boolean that is set whenever a NPC moves to and moves away from this trigger box and use it as a check whether to move or not the other NPC to the desired location.

To reach that, use the Box Trigger event Begin Overlap to know when an Actor gets inside the box and event End Overlap when an Actor gets out from the box. Set the value of the boolean whenever you call these events.

So something like this? I’m fairly new to unreal so it may be wrong!

I’m not familiar enough with blackboards but you should make your logic like this:
When an NPC enters the box trigger (Begin overlap), you must tell your blackboard that someone is already in the box trigger. It must be something similar to a bool that is set to true.
When it leaves the box trigger (End overlap), set this value to false and use this as a condition to move another NPC to that location.
As I said, I’m not familiar enough with blackboards, so maybe it’s missing something, but this is an overview of what you must achieve using AI.