Dialogue System Question

nitrox32

Member
I have an NPC that is using BD to wander in a scene. When my player approaches the NPC Dialogue System has the NPC turn to face the player to start a conversation. When this happens I get the following error that repeats until the cnversation is over. This happens only during a conversation.

"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.Wander:OnUpdate() (at Assets/Behavior Designer Movement/Scripts/Tasks/Wander.cs:30)
BehaviorDesigner.Runtime.BehaviorManager:RunTask(BehaviorTree, Int32, Int32, TaskStatus)
BehaviorDesigner.Runtime.BehaviorManager:Tick(BehaviorTree)
BehaviorDesigner.Runtime.BehaviorManager:Tick()
BehaviorDesigner.Runtime.BehaviorManager:Update()
 
Never mind. Tony at Pixelcrushers helped me out. He offered two possible solutions:

1. From the Behavior Designer side: In your behavior tree, add a branch that checks "Is Conversation Active". If this is true, stop trying to navigate around.

or

2. From the Dialogue System side: In the NPC's Dialogue System Events component, configure OnConversationStart() to call the Behavior's DisableBehavior:true, and configure OnConversationEnd() to call EnableBehavior.


The advantage of #1 is that it allows the behavior tree to keep running during the conversation. The advantage of #2 is that you don't have to fiddle with another branch (Is Conversation Active) in your behavior tree. I used solution #2 but I'm sure solution #1 would work as well.
 
Top