Game Development Reference
In-Depth Information
This problem occurs because of the Radius setting in the Navigation window. Radius defines an
imaginary circle that would entirely encompass a hypothetical agent, expected to walk on the mesh.
Since agents are usually characters, they have both width and depth. Therefore, agents can't walk
exactly against walls or other physical obstacles, because their very tangibility blocks them from
passing. They'll always walk slightly away from the wall or a physical obstacle. For this reason, the
Radius setting adds an extra unwalkable buffer of space between the NavMesh edge and a physical
obstacle, such as the wall, to prevent clipping and errant collisions.
This also explains why there's breakage or disconnection in the NavMesh at doorways. This is
because there's simply not enough room on the floor between either sides of the door to allow an
agent to pass. This hints at the solution: to reduce the Radius setting. If your NavMesh seems too
thin for your floor or is broken apart inside doorways, then try reducing the radius. For my scene, I've
lowered the radius from 1 to 0.4 . This still leaves appropriate space between the NavMesh and walls,
but also allows travel through doorways. Take a look at Figure 2-39 . Later in Chapter 7, when adding
enemy agents, this value may need further revision.
Figure 2-39. Decreasing NavMesh Radius to increase the walkable regions in the scene
NavMesh is offset upward above the floor. The NavMesh is an approximation
of the environment geometry in general, meaning there's room for inaccuracy.
Sometimes your NavMesh will seem to hover above the true scene floor, rather
than rest on it or close to it, as you might expect it to do (see Figure 2-40 ).
 
Search WWH ::




Custom Search