Roblox Wiki
Roblox Wiki
38,912
pages
Missing API Documentation
This API Class does not have any or complete API documentation. Please add API documentation if possible.

FloatCurves represent a one-dimensional curve, containing an ordered list of FloatCurveKeys which represent a vertex at a specified time. FloatCurve inherits from Instance.

Properties

Length: int

  • Read-onlyThis property is capable of being read but not written.
  • Not replicatedThis member is not replicated across the network boundary.

Represents the number of FloatCurveKeys in the FloatCurve.

  • Category: Data.
  • Serialization: can save only.
  • Thread safety: read safe

Methods

GetKeyAtIndex(index: int): FloatCurveKey

Parameters
NameType
indexint

Returns the FloatCurveKey at the given index.

  • Thread safety: unsafe

GetKeyIndicesAtTime(time: float): Array

Parameters
NameType
timefloat

Returns an array of two numbers. The first number represents the index of the last FloatCurveKey whose Time property is less than or equal to time, or 1 if no FloatCurveKey meets the specified conditions. The second number represents the index of the first FloatCurveKey whose Time is greater than or equal to time, or the FloatCurve's Length if no FloatCurveKey meets the specified conditions.

  • Thread safety: unsafe

GetKeys(): Array

Returns an array populated with this FloatCurve's FloatCurveKeys.

  • Thread safety: unsafe

GetValueAtTime(time: float): float?

Parameters
NameTypeDescription
timefloatThe time at which the FloatCurve will be sampled.

Returns the number sampled along the FloatCurve at time.

  • Thread safety: unsafe

InsertKey(key: FloatCurveKey): Array

Parameters
NameTypeDescription
keyFloatCurveKeyThe FloatCurveKey to insert

Inserts a FloatCurveKey into the FloatCurve.

  • Thread safety: unsafe

RemoveKeyAtIndex(startingIndex: int, count: int = 1): int

Parameters
NameTypeDefaultDescription
startingIndexintThe index of the first key to remove
countint1The number of keys to remove

Removes count FloatCurveKeys from the FloatCurve, starting at startingIndex. Returns the number of keys that were removed.

  • Thread safety: unsafe

SetKeys(keys: Array): int

Parameters
NameTypeDescription
keysArrayThe array of FloatCurveKeys that will replace the FloatCurve's existing FloatCurveKeys

Completely overwrites this FloatCurve's FloatCurveKeys with the given keys. Returns the number of FloatCurveKeys that were inserted.

  • Thread safety: unsafe

External links[]