Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetLinkOwner(NavMeshLinkInstance)

Gets the object, if any, that is associated with the link instance.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine.AI
  • Assembly: UnityEngine.AIModule
public static Object GetLinkOwner(NavMeshLinkInstance handle)

Parameters

The identifier of the link instance whose owner needs to be retrieved.

Returns

Type

Description

ObjectThe object that was passed into NavMesh.SetLinkOwner for the specified link instance.

Remarks

Use this method to obtain a reference to the component that created the link, or more generally, to any object that contains useful information about this specific link that is active in the navigation system. We refer to that object as the "owner". The owner is null for any new link instance created with NavMesh.AddLink. Therefore you need to first call NavMesh.SetLinkOwner in order to retrieve the same object later. This "owner" is also referenced by the OffMeshLinkData.owner property when you query for the next link on a NavMesh agent's path.
When the link instance is removed the owner property returns null once again.
Additional Resources: OffMeshLinkData.owner.