navMesh GetRemainingDistance

Aseliot

New member
I know nav mesh and agents are not a part of the package but this is just a little silly problem.
I've used nav mesh agents without any problems before but it just keeps repeating this error now and I've already been checking the same things 10 times over.

- The agent is on a nav mesh (above it)
- I already baked the nav mesh, the plane is static and the blue indication is showing
- agent is set to humanoid
- Also tried putting the agent a little bit higher or a lot higher but with the same result.

Code:
"GetRemainingDistance" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
BehaviorDesigner.Runtime.Tasks.Movement.NavMeshMovement:HasArrived () (at Assets/Behavior Designer Movement/Scripts/Tasks/NavMeshMovement.cs:104)
Opsive.DeathmatchAIKit.AI.Actions.SearchForTarget:OnUpdate () (at Assets/Opsive/DeathmatchAIKit/Scripts/AI/Actions/Attack/SearchForTarget.cs:97)
BehaviorDesigner.Runtime.BehaviorManager:RunTask (BehaviorDesigner.Runtime.BehaviorManager/BehaviorTree,int,int,BehaviorDesigner.Runtime.Tasks.TaskStatus)
BehaviorDesigner.Runtime.BehaviorManager:Tick (BehaviorDesigner.Runtime.BehaviorManager/BehaviorTree)
BehaviorDesigner.Runtime.BehaviorManager:Tick ()
BehaviorDesigner.Runtime.BehaviorManager:Update ()

1669833456186.png
1669833469968.png

What else is there left to check?
 
It looks like you are getting other errors in the console (I see a DetermineWeapon.cs). That looks like it's from the Deathmatch AI Kit? I would first fix any other errors to ensure that works and then see if the navmesh error pops up. The only other thing that I can think of is that the NavMeshAgent isn't enabled.
 
It looks like you are getting other errors in the console (I see a DetermineWeapon.cs). That looks like it's from the Deathmatch AI Kit? I would first fix any other errors to ensure that works and then see if the navmesh error pops up. The only other thing that I can think of is that the NavMeshAgent isn't enabled.

Ok for some reason the agent appears to be deactived when running the scene but I am not sure why yet.

When I enable it manually the agent appears to move but the character doesn't go along with it.

h3467h367g23456g2456.jpg
 
Ok for some reason the agent appears to be deactived when running the scene but I am not sure why yet.
A deactivated agent will definitely cause the error to appear. I would check within the PathfindingMovement ability to determine if you are able to tell why it's being disabled.
 
A deactivated agent will definitely cause the error to appear. I would check within the PathfindingMovement ability to determine if you are able to tell why it's being disabled.
Alright it was because of the Nav Mesh Agent Movement ability not being enabled.

But the null error is from DetermineWeapon m_WeaponPool index being null? The array has a first value as a weapon but the rest of it is null, but I am not sure where this comes from?
 
If you set a breakpoint within DetermineWeapon what type of weapon is trying to be spawned? I am thinking that for example a melee or power weapon is trying to be spawned that you don't have.
 
If you set a breakpoint within DetermineWeapon what type of weapon is trying to be spawned? I am thinking that for example a melee or power weapon is trying to be spawned that you don't have.
Alright so I redid the whole scene according to the video and it almost work now except the AI is just looking/aiming at me and not firing or able to kill me for some reason but there are no errors.
 

Mh ah yeah I see the AI's in the deathmatch demo scene also have the abilities set up like that.

However I edited the behaviour tree with my own TargetInSight (only difference is the type of component it uses for detection) and it appears to be detecting my own player now.

But I keep getting error from the StartCover ability now for some reason where m_CoverPoint is null, but I think that the Shared variable from the behavior tree are not getting passed properly for some reason? I also had issues with the fieldOfView and viewDistance shared variable values being passed as 0 and not 170 and 20 as specified in the tree.

1670321758710.png
 
StartCover shouldn't be started if there is no cover point. Do you know why it's starting?
 
StartCover shouldn't be started if there is no cover point. Do you know why it's starting?

Ah yes, I was trying to edit the behaviour trees but didn't properly replace the scripts with my own and forgot to set the values of target etc. again in the behaviour tree inspector.

I got the detection/attacking working now.
 
Top