Wait for NavMeshAgent to move to position

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Wait for NavMeshAgent to move to position

Post by Tony Li »

Aha, that should be easy to solve. Change your Sequence from:

Code: Select all

NavMeshDestination(Alfonso, Gramps)
to:

Code: Select all

NavMeshDestination(Alfonso, Gramps)->Message(Arrived);
Continue()@Message(Arrived)
Also, in your custom sequencer command, you might want to add an OnDestroy() method that makes sure the NavMeshAgent is at its destination position in case the player clicks the continue button early.

If you don't want the player to be able to click the continue button during the navigation, you can change the sequence to:

Code: Select all

SetContinueMode(false);
NavMeshDestination(Alfonso, Gramps)->Message(Arrived);
required SetContinueMode(true)@Message(Arrived);
Continue()@Message(Arrived)
hidingso
Posts: 26
Joined: Sat Sep 25, 2021 2:07 pm

Re: Wait for NavMeshAgent to move to position

Post by hidingso »

Tony, you are a hero!

Glad I did a bit of a dive into the custom sequencer commands. It's seemingly possible to do pretty much anything with them!
User avatar
Tony Li
Posts: 21973
Joined: Thu Jul 18, 2013 1:27 pm

Re: Wait for NavMeshAgent to move to position

Post by Tony Li »

Glad to help. Sequencer commands are definitely handy, and faster and more compact to set up than interactive sequencers like Timeline.
Post Reply