Navigating 3D space in Unity
When we talk about navigation in real life, it’s usually a conversation about how to get from point A to point B. Navigating around virtual 3D space is largely the same, but how do we account for the experiential knowledge we humans have accumulated since the day we first started crawling? Everything from walking on a flat surface to climbing stairs and jumping off of curbs is a skill we learned by doing; how can we possibly program all that into a game without going insane?
Before you can answer any of these questions, you’ll need to know what navigation components Unity has to offer.
Navigation components
The short answer is that Unity has spent a lot of time perfecting its navigation system and delivering components that we can use to govern how playable and non-playable characters can get around. Each of the following components comes as standard with Unity and has complex features already built in:
- A NavMesh is...