Page 1 of 1

Resume NavMeshAgent on ending conversation

Posted: Thu Mar 07, 2024 3:51 pm
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!

Re: Resume NavMeshAgent on ending conversation

Posted: Thu Mar 07, 2024 4:37 pm
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.

Re: Resume NavMeshAgent on ending conversation

Posted: Thu Mar 07, 2024 5:47 pm
by mroshaw
For anyone interested, I solved this by simply setting MAnimal.LockMovement to true and false in the OnConversationStart and OnConversationEnd events respectively.

Re: Resume NavMeshAgent on ending conversation

Posted: Thu Mar 07, 2024 7:10 pm
by Tony Li
Thanks for sharing the info!