Challenge 2: Create a NavMesh Agent
Tutorial
·
Beginner
·
+10XP
·
30 mins
·
(136)
Unity Technologies

- Configure a NavMesh Agent to move around the scene’s NavMeshes
- Customize the movement settings (slope, height, radius, step height)
Languages available:
1. Configure a NavMesh Agent
1. Select the Player GameObject in the Scene and in the Inspector add the NavMeshAgent Component and set the Base Offset value to 1 to compensate for the gap between the floor and the bottom of the Player’s mesh.


2. Create a new C# script called “PlayerController” and open it in your code editor.

3. Add the following logic to the script so that mouse clicks update the Agent’s target position

4. Back in the Unity Editor add your newly created PlayerController to the Player GameObject and configure the Serialized Values


5. Click Play and click around the Scene to see the NavMeshAgent move
