Enemy AI Small Demo Clip
Enemy’s will have the ability to patrol certain areas in order to make a stealth approach more difficult.
This waypoints system is made with a NavMeshAgent.
Checking if the player is visible or not by using a Raycast to see if objects are blocking the line of sight.
But first checking the distance between the player and the enemy.
If the player is within that visible range then check if objects, like for example a wall, aren’t blocking the line of sight.
The enemy’s Field of View is also limited, so use objects to get past them without confrontation.