NavMesh Iink Error

serenity

Member
Hi,
I am using NavMesh Components as apposed to built in NavMesh and having errors when using NavMesh Links in the scene.

Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateCharacterController.Character.Abilities.AI.NavMeshAgentMovement.UpdateOffMeshLink () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/AI/NavMeshAgentMovement.cs:111)
Opsive.UltimateCharacterController.Character.Abilities.AI.NavMeshAgentMovement.Update () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/Abilities/AI/NavMeshAgentMovement.cs:61)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateAbilities (Opsive.UltimateCharacterController.Character.Abilities.Ability[] abilities) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:768)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion.UpdateUltimateLocomotion () (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:699)
Opsive.UltimateCharacterController.Character.CharacterLocomotion.Move (System.Single horizontalMovement, System.Single forwardMovement, System.Single deltaYawRotation) (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:486)
Opsive.UltimateCharacterController.Game.KinematicObjectManager+KinematicCharacter.FixedMove (System.Boolean manualMove) (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:202)
Opsive.UltimateCharacterController.Game.KinematicObjectManager.FixedUpdate () (at Assets/Opsive/UltimateCharacterController/Scripts/Game/KinematicObjectManager.cs:751)

Now this error only appears when I am using NavMesh Links and the AI or even the Playable character goes over that area that the NavMesh link is present in.
So it doesn't happen while AI or Player are in other Areas in the NavMesh and NavMesh Components is working no problem.

One weird behavior that happens is when I make the Player Character jump over the NavMesh Link The Lowe body move over the Fence (NavMesh Link) but the upper body stays before the Fence and the waist area gets stretched like a Pledo connecting both body parts together.
 
What is null in that case? Is it m_NavMeshAgent.currentOffMeshLinkData? This shouldn't happen because isOnOffMeshLink is true.
 
It shouldn't happen as you said because navmesh surface component is working and it has the proper reference.

I dug a little bit deepr:

"Off-mesh Link" is a feature of unity's built in standard NavMesh
"NavMesh Link" is a feature of unity's newer "NavMesh Components"

There both perform basically the same thing but for different NavMesh systems but they should work with UCC regardless I think as the main feature of "NavMesh Components" that build the navigation mesh "NavMesh Surface" is working with UCC no problem.

It seems isOnOffMeshLink is always returning false for "NavMesh Components" according to the following short reads:

(I think this link mostly defines the problem and the fix)

(The link on the first post has some interesting info that could help)


Maybe this will help you solve the issue or give me more info on how to do it my self.
 
Last edited:
Ahh, ok. In this case it looks like it'll take some special case for the NavMesh components. I won't be able to add support for it before version 2.2 but have added it to my feature request list. This will probably take a separate integration, similar to Cinemachine.
 
Until I get more of a chance to look into it you could add a null check which checks for the currentOffMeshLinkData, or revert back to the built-in navmesh version.
 
I have the same problem, is there any fix for it? It looks like UCC agents offMeshLink is always null. I have test it with breakpoints and as serenity said, waist get stretched, legs are going and upper part of body stays at the same place.
 
Top