ArcBasicDocs
3DNavigationArcBasic extension

CreateNavMesh

Creates a navmesh for agents of a size.

CreateNavMesh ( [agent_radius#][,agent_height#][,max_slope#][,max_climb#][,cell_size#] )

Parameters

agent_radius# (optional)
how wide the characters are, as the radius of a circle round them. Paths keep this far from walls. Defaults to 0.5.
agent_height# (optional)
how tall they are; they don't go where the ceiling is lower. Defaults to 2.
max_slope# (optional)
the steepest slope they can walk up, in degrees. Defaults to 45.
max_climb# (optional)
the highest step they can climb, such as a stair. Defaults to 0.5.
cell_size# (optional)
how finely the world is measured. Smaller is more exact but slower to build; 0.25 suits worlds where a person is about 2 units tall.

Description

Creates a navmesh and gives back its handle. A navmesh is a map of where characters of a certain size can walk: floors, ramps and stairs they fit through and can climb, but not walls, steep slopes or gaps too narrow for them. Add the level's entities with NavMeshAdd, work out the map with BuildNavMesh, then make characters walk on it with EntityNavAgent and NavigateTo.

Characters of very different sizes, such as people and tanks, each need a navmesh of their own.

Example

CreateNavMesh.abs
nav = CreateNavMesh(0.5, 2)NavMeshAdd nav, levelBuildNavMesh navEntityNavAgent guard, nav, 3NavigateTo guard, 10, 0, 25

See also