Access 5.6 NavMeshLink script

In the previous Navigation system, I could access the offmesh link script by simply calling:

Agent.currentOffMeshLinkData.offMeshLink

when I detect that my agent is on an offmesh link. I see in the new system that the NavMeshLink does not extend the classic offmesh link and so the above method returns null.

How can I go about accessing the new NavMeshLink script when I detect that my agent is on an offmesh link?

The 'NavMeshAgent.navMeshOwner’ property returns the owner of the link or surface the agent is currently on (can be null if nothing set). See also:

1 Like

Perfect, thanks for the assist :slight_smile:

There wouldn’t happen to be a similar workaround if I want to find the NavMeshLink equivalent of NavMeshAgent.nextOffMeshLinkData? We’d like to switch over from OffMeshLinks to NavMeshLinks but some of our existing code needs to be able to read the links (specifically the start position) before the agent is actually on them.