Detection Distance help


I would like to know if / how it is possible to setup a detection zone, i.e. guards / zombies

My thought would be to setup a trigger box around myself and for example, every NPC within 100m will trigger if I am running within that distance.

Same as walking for 50 meters and maybe 5 meters for crawling.

Or would I need to setup a trigger box around every guard?


Both will work but you’ll have your box (sphere) around you allways and will need to deal with even when you don’t have enemies (by cast to for example). On the other hand a detection box around your ai character will be usable for more than only the enemy ( change movement direction / destination if box overlap electric wall or pit for example).
A good example, easy to implement is :

Hi Fen,

Fantastic, just what I was looking for.