Navigation
API > API/Runtime > API/Runtime/Navmesh > API/Runtime/Navmesh/dtCrowd
Description
Adds a new agent to the crowd.
The agent's position will be constrained to the surface of the navigation mesh.
| Name | addAgent |
| Type | function |
| Header File | /Engine/Source/Runtime/Navmesh/Public/DetourCrowd/DetourCrowd.h |
| Include Path | #include "DetourCrowd/DetourCrowd.h" |
| Source | /Engine/Source/Runtime/Navmesh/Private/DetourCrowd/DetourCrowd.cpp |
int addAgent
(
const dtReal * pos,
const dtCrowdAgentParams & params,
const dtQueryFilter * filter
)
The index of the agent in the agent pool. Or -1 if the agent could not be added.
Parameters
| Name | Remarks |
|---|---|
| pos | The requested position of the agent. [(x, y, z)] |
| params | The configutation of the agent. |
| filter | [UE] query filter used by agent |