Game Development Reference
In-Depth Information
Figure 7-13. A sample route for an Enemy character requires obstacle avoidance
In Chapter 2 we constructed the main environment for CMOD, and this included generating an
internal mesh structure, known as a NavMesh . To do this, we used the Navigation window (available
from the menu at Window Navigation ). When this window is active and the Show NavMesh
check box is enabled from the NavMesh Display utility window in the viewport, the NavMesh for the
scene will be displayed at the floor level, as shown in Figure 7-14 . The NavMesh is highlighted in
blue and represents the total surface area in the scene that Unity regards as walkable. That is, the
blue area marks out the region inside which travel and movement can occur. Now for most objects
in the scene, the NavMesh is completely ineffectual. It only applies to objects with a NavMeshAgent
component attached. Objects with this component attached become part of the pathfinding and
navigation system; these objects become linked to the navigation meshes and respond to intelligent
navigation. Let's see how by implementing each of the states for the FSM, in turn.
Search WWH ::




Custom Search