To make an NPC to travel to a destination while avoiding obstacles, follow these steps:
- Create a new, empty 3D project.
- Create a new 3D Terrain, choose menu: Create | 3D Object | Terrain. With this new Terrain GameObject selected in the Hierarchy, in its Inspector properties set its size to 30 x 20, and its position to (-15, 0, -10) so we have this GameObject centered at (0,0,0).
- Texture paint this terrain with the SandAlbedo texture.
- Create a 3D Capsule named Capsule-destination at (-12, 0, 8). This will be the target destination for our NPC self-navigating GameObject.
- Create a sphere named Sphere-arrow that is positioned at (2, 0.5, 2). Scale it to (1,1,1).
- Create a second sphere named Sphere-small. Scale it to (0.5, 0.5, ...