Search Issue Tracker

By Design

Votes

0

Found in

2017.3.0p1

Issue ID

992264

Regression

No

[NavMesh] currentOffMeshLinkData.offMeshLink always returns null even when agent is on OffMeshLink

AI Navigation

-

To reproduce:
1. Open my project attached
2. Enter Play mode
3. Observe the console

Expected: currentOffMeshLinkData.offMeshLink returns currently used offMeshLink
Actual: currentOffMeshLinkData.offMeshLink returns null (check .gif attached)

Reproduced in: 2017.2.2p1, 2017.3.1p4, 2018.1.0b11, 2018.2.0a4

Note1: isOnOffMeshLink() does return true when agent is on OffMeshLink
Note2: attached two project versions - one with 2017.1 NavMesh components, other with 2018.1
Note3: NavMesh components were throwing multiple errors when opening in 2017.1.3p2, despite being meant to be used with 2017.1
GitHub link: https://github.com/Unity-Technologies/NavMeshComponents/tree/2017.1

---
The `navMeshOwner` property of the agent can be used for retrieving the current NavMesh component that the agent is on. In the case of a NavMeshLink the code looks like this:
var link = (UnityEngine.AI.NavMeshLink)agent.navMeshOwner;
if (link)
{
...
}

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.