Roblox UtilitiesDevlHub Roblox Documentation

Data type

NumberSequenceKeypoint

Represents keypoint within a NumberSequence with a particular time, value, and envelope size.

The NumberSequenceKeypoint data type represents keypoints within a NumberSequence with a particular time, value, and envelope size.

Constructors 2#

newReturns a keypoint with the specified time and value.
newReturns a keypoint with the specified time, value, and envelope.

new(time: number, value: number)#

Returns a NumberSequenceKeypoint with the given time and value, with Envelope defaulting to 0 (no random variance). The time parameter should be a number between 0 and 1, and value can be any number.

NameTypeDefaultDescription
timenumberThe relative time position of the keypoint within the sequence, expressed as a number from 0 to 1.
valuenumberThe base numeric value at this keypoint's time position.

new(time: number, value: number, envelope: number)#

Returns a NumberSequenceKeypoint with the given time, value, and envelope. The envelope parameter must be a non-negative number that defines the amount of random variance applied to value at runtime; the actual output for this keypoint is chosen randomly within [value − envelope, value + envelope].

NameTypeDefaultDescription
timenumberThe relative time position of the keypoint within the sequence, expressed as a number from 0 to 1.
valuenumberThe base numeric value at this keypoint's time position.
envelopenumberThe amount of random variance that can be applied to the value at runtime; must be non-negative.

Properties 3#

EnvelopenumberThe amount of variance allowed from the value.
TimenumberThe relative time at which the keypoint is positioned.
ValuenumberThe base value of the keypoint.

Envelope: number#

The amount of variance allowed from the value. For example, a value of 0.5 with an envelope of 0.1 could compute to between 0.4 and 0.6 at runtime. The most common use case for this property is to randomize the size of particles (within the envelope) from a ParticleEmitter.

Time: number#

The relative time at which this keypoint is positioned within the parent NumberSequence, expressed as a number from 0 to 1 where 0 is the beginning of the sequence and 1 is the end. Within a NumberSequence, the first keypoint must have a time of 0 and the last keypoint must have a time of 1; any intermediate keypoints must be in ascending time order. The engine linearly interpolates values and envelopes between consecutive keypoints based on their time positions. Defaults to 0.

Value: number#

The base numeric value at this keypoint's position in the sequence. When the engine evaluates a NumberSequence, it linearly interpolates between adjacent keypoints' values based on time. If Envelope is greater than 0, the actual output at runtime may vary randomly within the range [Value − Envelope, Value + Envelope]. Defaults to 0.