Page 1 of 1

Send a Sequencer Message only after all Commands have run

Posted: Tue Mar 22, 2022 7:36 am
by LostTrainDude
[Unity 2019.4.36f1 - DS 2.2.25.1]

Hi Tony,

I know that by default, Commands in Sequences are not sequential, but I was wondering if there was a way to send a message that waited for *all* the commands in the Sequence to have run before getting broadcasted.

Because of course doing something like this:

Code: Select all

SetActive(GameObjectA, true); SetActive(GameObjectB, true)->Message(next);
only sends a message when the second Command has run, regardless of when it has happened.

As always, thanks in advance!
Chris

Re: Send a Sequencer Message only after all Commands have run

Posted: Tue Mar 22, 2022 11:01 am
by Tony Li
Hi Chris,

In the upcoming version 2.2.26, WaitForMessage() can wait for multiple messages. This patch contains the change:

DS_WaitForMessagePatch_2022-03-22.unitypackage

Example:

Code: Select all

SetActive(GameObjectA, true)->Message(ActivatedA);
SetActive(GameObjectB, true)->Message(ActivatedB);
WaitForMessage(ActivatedA, ActivatedB)->Message(ActivateC);
SetActive(GameObjectC, true)@Message(ActivateC)

Re: Send a Sequencer Message only after all Commands have run

Posted: Tue Mar 22, 2022 11:23 am
by LostTrainDude
Oh, wow! It was in the air already :)

Thanks a lot!

Re: Send a Sequencer Message only after all Commands have run

Posted: Tue Mar 22, 2022 11:28 am
by Tony Li
Glad to help!