Skip to main content

NavMeshAgent.SetDestination(Vector3 target)

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

Parameters:

NameTypeDescription
targetVector3The target point to navigate to.

Returns:

typeDescription
booleanTrue 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.