Placing the AI in the level and testing
OK! We are done! Now all we have to do is place the AI in the level and test that everything we have done works! Ensure you place the AI at least 1500 units away from the player so that it does not automatically detect the player's location. With the AI in level, press play and you will see something similar to this:
The red lines we are seeing is the debug sphere that is drawn during the sphere check. If you move within these lines, the AI will start to move towards you while pathing around the obstacles thanks to the NavMesh
! Once the AI has targeted you, try running outside the bounds of the detection sphere and wait. The AI will stop chasing you and begin to path between the home location and the last known target location.