Crowd Surface
Important
This page explains the functionalities of the Agents Navigation - Crowds extension package.
The Crowd Surface is a component that allows you to create a surface that agents can walk on. It is very similar to NavMeshSurface
in Unity's NavMesh system. The Width
and Height
represent the cell count on their respective axes; the higher the number, the more accurate navigation will be at the expense of performance.
It can be created using the menu GameObject > AI > Crowd Surface
.

Baking
In Crowd Surface, baking is an optional feature and can be used without it. However, it can be useful to prebake surface heights and obstacles in a similar way to Unity's NavMesh. To bake the surface, you first need to create a Crowd Data
asset. It can be created by right-clicking in the project view and selecting Create > AI > Crowd Data
. Then you need to assign it to the Crowd Surface
component. After that, you can bake the surface by pressing the Bake
button in the Crowd Surface
component.
Make sure the gizmos encapsulate your physics colliders you want your surface to be baked from. If everything is set up correctly, you should see the gizmos like this:

Note
Baking is currently here experimental and will improve in the future. Most of the CrowdData API is exposed so users would have full control over it.
Low Level
At the low level, it uses the Crowd World
structure, which is the core of this component. It is composed of multiple fields:
- Density Field: Each cell indicates agent coverage intensity.
- Average Velocity Field: Each cell indicates average agent speed.
- Obstacle Field: Each cell reference counts obstacle overlap.
- Discomfort Field: Each cell indicates discomfort coverage intensity.
- Height Field: Each cell indicates the height of the area.
Debugging
When selecting the component, you can see gizmos that will help you debug and understand what is happening. The Gizmos
option will allow selecting particular fields to be drawn.
Note
To make it work with Entities, you will need to add the DrawGizmos
component to the surface entity.