The NumberSequence data type represents a sequence of numbers. NumberSequence is most commonly used in effect classes such as Trail and ParticleEmitter. The NumberSequenceKeypoint data type is used to construct complex NumberSequence values.
local sequence = NumberSequence.new{ -- NumberSequenceKeypoint.new(time, value) NumberSequenceKeypoint.new(0, 1), -- start NumberSequenceKeypoint.new(0.25, 0.5), NumberSequenceKeypoint.new(0.5, 0.25), NumberSequenceKeypoint.new(0.75, 0.125), NumberSequenceKeypoint.new(1, 0), -- end }
NumberSequence[]
Constructors[]
- NumberSequence.new(n: number)
- Returns a NumberSequence with the start and end values set to
n
. - NumberSequence.new(n0: number, n1: number)
- Returns a NumberSequence with
n0
as the start value andn1
as the end value. - NumberSequence.new(Keypoints: Array { NumberSequenceKeypoint })
- Returns a NumberSequence from an array of two or more NumberSequenceKeypoint values, which must be in an ascending time value order.
Properties[]
NumberSequenceKeypoint[]
NumberSequenceKeypoint represents two number values: time (from 0 to 1) and value. The additional third value is used as the size of the value's envelope representing the amount of variance from the value. These values form a keypoint used in complex NumberSequence values.
Constructors[]
- NumberSequenceKeypoint.new(time: number, value: number)
- Returns a keypoint with the specified time and value.
- NumberSequenceKeypoint.new(time: number, value: number, envelope: number)
- Returns a keypoint with the specified time, value and envelope.
Properties[]
- Envelope number
- The amount of variance allowed from the value of the keypoint.
- Time number
- The relative time at which the keypoint is positioned (from 0 to 1). 0 represents the start value (first) while 1 represents the end value (last).
- Value number
- The value of the keypoint.
Referenced by[]
Basic Lua types | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Roblox types |
| ||||||||||||||||||||||||||
API reference only |