in_sequence

This is a built-in variable that is part of the Instance Variables created for every object instance in your game. If the instance is being controlled by a sequence, this variable will return true, otherwise it will return false. This is a read-only variable and cannot be changed.

Note that this variable will become false after the controlling sequence has ended, even if its sequence element still exists, and will become true if that sequence element is played again.

You can use this variable in your player (or CPU) controlled objects to make sure that they're only moved by code when they're not in a sequence. This can prove useful for cutscenes, when you need to use the same instances in a sequence (using the sequence_instance_override_object function) and you need to make sure that they can't be moved by their usual code while that cutscene is active.

 

Syntax:

in_sequence

 

Returns:

Boolean

 

Example:

if (!in_sequence)
{
    x += move_x;
    y += move_y;
}

The above code checks the in_sequence variable, and if it is false (meaning the instance is not being controlled by a sequence) then it adds move_x and move_y to the instance's position, making sure that it only moves when it's not in a sequence.