Resume NavMeshAgent on ending conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

Resume NavMeshAgent on ending conversation

Post by mroshaw »

Hello again!

I'm using this Sequencer string to "pause" my Malbers AI NPC, when I kick off a conversation with them:

NavMeshAgent(stop,speaker);LookAt(listener); Camera(Medium Left,speaker,1);

This works a treat, however I'd like the NPC to resume their navigation once the conversation ends.

Can I do this with the Sequencer?

Many thanks!

EDIT:

I've tried using Dialog System Events for this. I've added a DialogSystemEvents component to my NPC, and hooked up the "OnConverstaionStart" and "OnConversationEnd" events to the NavMeshAgent "isStopped" public property. This works for the first time I have a conversation with the NPC. However, if I then start the conversation again, the events aren't invoked.

EDIT:

I'm wrong - the events ARE being invoked. It's the NavMeshAgent that's misbehaving!
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

Re: Resume NavMeshAgent on ending conversation

Post by mroshaw »

Yeah, totally my fault! It would appear that Malbers AI is overriding my changes to the NavMeshAgent and forcing it to resume while I'm in conversation.

I'll be able to work around that, so I'll use the DialogSystemEvents component, rather than mess around with Sequences for this.
mroshaw
Posts: 96
Joined: Wed Jan 19, 2022 4:10 am

Re: Resume NavMeshAgent on ending conversation

Post by mroshaw »

For anyone interested, I solved this by simply setting MAnimal.LockMovement to true and false in the OnConversationStart and OnConversationEnd events respectively.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resume NavMeshAgent on ending conversation

Post by Tony Li »

Thanks for sharing the info!
Post Reply