computer ai

Blitz3D Forums/Blitz3D Beginners Area/computer ai

Attach a pivot to the enemy to act as their eyes.

Pointentity this pivot to the target then do an entitypick.

If the pick can see your target then check the EntityYaw of the pivot for your field of view e.g. for a 90 degree field of view do

If abs(entityyaw(lookpivot))<45
;Turn toward player etc...