[ISSUE] ["Movement" ADD-ON] Bug in the Patrol task with the NavMesh?

#1
When I try to have a NavMesh dragon patrol, the Unity Console throws me this error:

"GetRemainingDistance" can only be called on an active agent that has been placed on a NavMesh.
UnityEngine.AI.NavMeshAgent:get_remainingDistance()
BehaviorDesigner.Runtime.Tasks.Movement.NavMeshMovement:HasArrived() (at Assets/Behavior Designer Movement/Scripts/Tasks/NavMeshMovement.cs:104)
BehaviorDesigner.Runtime.Tasks.Movement.Patrol:OnUpdate() (at Assets/Behavior Designer Movement/Scripts/Tasks/Patrol.cs:45)
BehaviorDesigner.Runtime.BehaviorManager:RunTask(BehaviorTree, Int32, Int32, TaskStatus)
BehaviorDesigner.Runtime.BehaviorManager:Tick(BehaviorTree)
BehaviorDesigner.Runtime.BehaviorManager:Tick()
BehaviorDesigner.Runtime.BehaviorManager:Update()
I don't know what the problem is; I've baked the NavMesh on the floor, recreated the Avatar for the dragon, and run through the code in the task, and I don't know what to do. Please help!

Also, if you need it, here's a screenshot (sorry for not full Unity, image was too big if I didn't cut down):

1549419485368.png
 

Attachments

Justin

Administrator
Staff member
#2
That error is coming from the Unity side of things and it generally means that the navmesh isn't baked. I know that you said that you baked the navmesh but I have only seen that error when the navmesh isn't baked.
 
#3
That error is coming from the Unity side of things and it generally means that the navmesh isn't baked. I know that you said that you baked the navmesh but I have only seen that error when the navmesh isn't baked.
Thank you. I'll try baking it again.


(EDIT:
1549933554603.png
Welp. It's already baked. Not sure what to do. Does anyone else have any suggestions? Also, thanks again, Justin.)
 
Last edited:

Justin

Administrator
Staff member
#4
Where is your agent located? Is it on the navmesh? Beyond that I would try just a regular plane similar to the demo scene to get that aspect working, and then slowly moving up from there.
 
#5
The agent is the dragon and is on the NavMesh. I'll try the plane idea though. Thanks.

(EDIT: I tried the plane, and I got the same errors. Although I just noticed a warning worth mentioning: "Failed to create agent because it is not close enough to the NavMesh". Probably the problem, but I have one question: Is right on top of it not close enough or something? I'm thinking about reporting a bug to Unity, although it may not be a bug; not sure yet.)
 
Last edited:
Top