기술 자료

Unity Engine

Unity Engine

SetPath(NavMeshPath)

Assign a new path to this agent.
읽는 시간 1분최근 업데이트: 25일 전

Definition

  • Type: Method
  • Namespace: UnityEngine.AI
  • Assembly: UnityEngine.AIModule
public bool SetPath(NavMeshPath path)

Parameters

New path to follow.

Returns

Type

Description

boolTrue if the path is successfully assigned.

Remarks

If you successfully assign the path, the agent resumes movement toward the new target. If the path cannot be assigned, the path is cleared (see NavMeshAgent.ResetPath). A path that was calculated for a different agent type than this agent's NavMeshAgent.agentTypeID is ignored: the method returns false and the agent keeps its current path. Use NavMeshAgent.CalculatePath or NavMesh.CalculatePath with a
NavMeshQueryFilter
to obtain a path for this agent type.