What would be the best way to create an NPC/object that moves when not in the player's view?

I was thinking of creating numerous trigger boxes and have an event tick constantly firing line traces from the center of the player’s view. This would allow me to trigger various different scenarios only when the player is in range and has the appropriate conditions completed e.g. finding a previous item or opening a certain door.

Is this the most efficient way of achieving this effect or is there another approach I could use instead?

Thanks for reading.

Just setup a behavior tree with a task that checks if its in the players field of view before running it’s other tasks.

As someone who has not used behaviour trees yet, this seems very complex when looking at examples. Is there an advantage to doing it in this format?


It’s also what it was designed for so better than doing it all through blueprints. Makes debugging much easier too and you can see what each AI is doing and all their values very easily. Try out a couple of AI tutorials and you will see it’s quite easy to use once you get past the initial oddities.