Skip to content

ValueCurve

Not yet Class Other

A sorted list of time-value pairs that define a curve. Used to animate any type of value.

Not implemented yet

This class exists in the current Roblox API but is not implemented in Nova yet. Scripts that reference it will fail at runtime.

0 Nova members · 16 modern Roblox members not implemented yet

Description

An instance representing a 1D value curve encoded via a sorted list of ValueCurveKeys. The shape of the interpolation curve between two keys is determined by the ValueCurveKey.Interpolation type.

Not all value types (for example, strings and other non-numerical types) may perform Linear or Cubic interpolation. These types will revert to Constant interpolation if necessary.

Inheritance

Object → Instance → ValueCurve

Properties

Member Signature Summary
Length Length: int Number of keys in the value curve.
ValuesAndTimes ValuesAndTimes: BinaryString —
ValueType ValueType: string Read-only value indicating the type held in this curve.

Methods

Member Signature Summary
GetKeyAtIndex ValueCurve:GetKeyAtIndex(index: int): ValueCurveKey Returns a copy of a key at a given index.
GetKeyIndicesAtTime ValueCurve:GetKeyIndicesAtTime(time: float): Array Returns the index of the last and first key of a period of time.
GetKeys ValueCurve:GetKeys(): Array Returns a copy of all the keys in the ValueCurve as a Luau array of ValueCurveKeys.
GetValueAtTime ValueCurve:GetValueAtTime(time: float): Variant? Samples the value curve at a given time passed as argument.
InsertKey ValueCurve:InsertKey(key: ValueCurveKey): Array Adds the key passed as an argument to this curve. If a key at the same time is found, it will be replaced.
InsertKeyValue ValueCurve:InsertKeyValue(time: float, value: Variant, keyInterpolationMode: KeyInterpolationMode = Constant): Array Creates a key for the given value and inserts it at the given time. If a key at the same time is found, it will be replaced.
RemoveKeyAtIndex ValueCurve:RemoveKeyAtIndex(startingIndex: int, count: int = 1): int Removes a given number of keys starting from a given index.
SetKeys ValueCurve:SetKeys(keys: Array): int Resets this curve's keys using the ValueCurveKey array passed as an argument.

Roblox reference: ValueCurve

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.