Page 1 of 1

How to check if a sequence is playing

Posted: Thu Mar 23, 2023 12:54 am
by n_hagialas
Hi, how can I check if a sequence (we typically use them to write cutscenes) is currently playing?
We want to disable Menu's from being openable during them.

Thanks!

Re: How to check if a sequence is playing

Posted: Thu Mar 23, 2023 1:42 am
by Tony Li
Hi Nik,

Add a script to the Dialogue Manager that has OnSequenceStart(Transform) and OnSequenceEnd(Transform) special script methods. Example:

Code: Select all

private int numActiveSequences = 0;

public bool IsSequenceActive => (numActiveSequences > 0);

void OnSequenceStart(Transform actor) { numActiveSequences++; }

void OnSequenceEnd(Transform actor) { numActiveSequences--; }