3 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

NumberSequenceKeypoint

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

Constructors

NameType / ReturnsDescription
NumberSequenceKeypoint.newReturns a keypoint with the specified time and value.
NumberSequenceKeypoint.newReturns a keypoint with the specified time, value, and envelope.

NumberSequenceKeypoint.new

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.

Parameters

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.

NumberSequenceKeypoint.new

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].

Parameters

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

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

NumberSequenceKeypoint.Envelope

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.

FieldValue
typenumber

NumberSequenceKeypoint.Time

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.

FieldValue
typenumber

NumberSequenceKeypoint.Value

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.

FieldValue
typenumber