Skip to content

Api > NavMeshAgent > SetDestination()


NavMeshAgent.SetDestination(Vector3 target)⚓︎

Sets or updates the destination thus triggering the calculation for a new path.

Parameters:⚓︎

Name Type Description
target Vector3 The target point to navigate to.

Returns:⚓︎

type Description
boolean True if the destination was requested successfully, otherwise false.

Usage⚓︎

---@type NavMeshAgent
local navmeshagent;

---@type Vector3
local target;


local val0 = navmeshagent.SetDestination(target)

Extra Detail⚓︎

Note that the path may not become available until after a few frames later. While the path is being computed, pathPending will be true. If a valid path becomes available then the agent will resume movement.