Im setting up a pathfinding enemy AI that will check for distance of the player. That part I have no issue with. What Im unsure about is how to only check in front of the enemy. Anyone know the best way to go about that?
Check the angle of (playerPosition-AIposition) and (aiTransform.forward).
if ( Vector3.Angle(ai.forward, vectorToPlayer) > sightAngle ) { // 'can't see player'