Skip to main content

Sequence

Sequences are animations that can be controlled from scripts.

Properties​

PropertyTypeDescription
EnabledbooleanPlaying or not
PositionnumberCurrent time in seconds the sequence is set to
LengthnumberTotal length of the sequence in seconds - dynamically derived from all tracks
PlayModenumberPlay direction, __Sequence_PlayForwards (0), or __Sequence_PlayBackwards (1)
PlayCountnumberNumber of times to play sequence, if less than 0, it loops forever
PlaySpeednumberScalar value to apply to the timestep value when playing - 1.0 normal speed, 0.5 half speed, 2.0 double speed, etc
PlayUservrnodeThe user triggering the sequence playback (when playing a sequence with a body track this dictates which user flies in a collaborative session)

Example​

This script prints the length and play speed of a sequence to the Log window and the sets the sequence to play forever and starts the sequence playing.

-- Drag/Drop section BEGINS - Do not edit between BEGINS and ENDS.
local Sequence = __Script.dragdrop.Sequence
-- Drag/Drop section ENDS

print("Length = ", Sequence.Length)
print("Speed = ", Sequence.PlaySpeed)

-- set the sequence to play forwards
Sequence.PlayMode = 0

-- set the sequence to play forever
Sequence.PlayCount = -1

-- set the sequence to play
Sequence.Enabled = 1