Function AgentOffMeshLinkTraversalContext.MoveTowards
MoveTowards
(float3 position, quaternion rotation, bool gravity, bool slowdown)
Move towards a point while ignoring the navmesh.
Public
MovementTarget MoveTowards (
float3 | position | The position to move towards. |
quaternion | rotation | The rotation to rotate towards. |
bool | gravity | If true, gravity will be applied to the agent. |
bool | slowdown | If true, the agent will slow down as it approaches the target. |
Move towards a point while ignoring the navmesh.
This method should be called repeatedly until the returned MovementTarget.reached property is true.
Return
A MovementTarget struct which can be used to check if the target has been reached.
Note
This method completely ignores the navmesh. It also overrides local avoidance, if enabled (other agents will still avoid it, but this agent will not avoid other agents).
See
For more control, you can set movementControl directly.