Skip to content
Roblox API Reference

ValueCurve

A sorted list of time-value pairs that define a curve. Used to animate any type of value.
Memory category
Instances
Own members
11
Inherited members
75
Subclasses
0
Siblings
608

Properties26

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byValueCurve3

Property categoryData

  • ValueCurve.Length: number = 0
    Number of keys in the value curve.
    • Read only
    • Read capabilities: Basic
    • Save only
  • ValueCurve.ValuesAndTimes: string = "\u0002"
    • Hidden
    • Not scriptable
    • Read capabilities: Basic
  • ValueCurve.ValueType: string = nil
    Read-only value indicating the type held in this curve.
    • Read only
    • Read capabilities: Basic
    • Save only

Methods50

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byValueCurve8
  • ValueCurve:GetKeyAtIndex(index: number): ValueCurveKey
    Returns a copy of a key at a given index.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    index: number
    The index in the existing set of keys held by this ValueCurve.
    Returns
    TypeDescription
    ValueCurveKey
    A copy of the ValueCurveKey stored at the given index.
  • ValueCurve:GetKeyIndicesAtTime(time: number): { any }
    Returns the index of the last and first key of a period of time.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    time: number
    A time during the animation. Inputs will be clamped between 0 and the time of the last key held by this ValueCurve.
    Returns
    TypeDescription
    { any }
    An array of two indices bracketing time: the index of the last key at or before time, and the index of the first key at or after time.
  • ValueCurve:GetKeys(): { any }
    Returns a copy of all the keys in the ValueCurve as a Luau array of ValueCurveKeys.
    • Capabilities: Basic
    Returns
    TypeDescription
    { any }
    Array of ValueCurveKeys.
  • ValueCurve:GetValueAtTime(time: number): any?
    Samples the value curve at a given time passed as argument.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    time: number
    Time at which to sample the curve.
    Returns
    TypeDescription
    any?
    Value of the curve at the requested time.
  • ValueCurve:InsertKey(key: ValueCurveKey): { any }
    Adds the key passed as an argument to this curve. If a key at the same time is found, it will be replaced.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    key: ValueCurveKey
    ValueCurveKey to insert.
    Returns
    TypeDescription
    { any }
    (see description)
  • ValueCurve:InsertKeyValue(time: number,value: any,keyInterpolationMode: Enum.KeyInterpolationMode? = Enum.KeyInterpolationMode.Constant,): { any }
    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.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    time: number
    Time at which to insert the new ValueCurveKey. - type: number
    value: any
    Value of the inserted ValueCurveKey. - type: any
    keyInterpolationMode: Enum.KeyInterpolationMode? = Enum.KeyInterpolationMode.Constant
    Returns
    TypeDescription
    { any }
    (see description)
  • ValueCurve:RemoveKeyAtIndex(startingIndex: number, count: number? = 1): number
    Removes a given number of keys starting from a given index.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    startingIndex: number
    Starting index from which to remove keys.
    count: number? = 1
    Number of keys to remove.
    Returns
    TypeDescription
    number
    Number of keys removed.
  • ValueCurve:SetKeys(keys: { any }): number
    Resets this curve's keys using the ValueCurveKey array passed as an argument.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    keys: { any }
    Array of ValueCurveKeys.
    Returns
    TypeDescription
    number
    Number of keys inserted.

Events10

Inherited fromObject1
Inherited fromInstance9