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
Represents the number of FloatCurveKeys in the FloatCurve.
- Category: Data.
- Serialization: can save only.
- Thread safety: read safe
Methods
GetKeyAtIndex(index: int): FloatCurveKey
| Name | Type |
|---|---|
| index | int |
Returns the FloatCurveKey at the given index.
- Thread safety: unsafe
GetKeyIndicesAtTime(time: float): Array
| Name | Type |
|---|---|
| time | float |
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?
| Name | Type | Description |
|---|---|---|
| time | float | The time at which the FloatCurve will be sampled. |
Returns the number sampled along the FloatCurve at time.
- Thread safety: unsafe
InsertKey(key: FloatCurveKey): Array
| Name | Type | Description |
|---|---|---|
| key | FloatCurveKey | The FloatCurveKey to insert |
Inserts a FloatCurveKey into the FloatCurve.
- Thread safety: unsafe
RemoveKeyAtIndex(startingIndex: int, count: int = 1): int
| Name | Type | Default | Description |
|---|---|---|---|
| startingIndex | int | The index of the first key to remove | |
| count | int | 1 | The 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
| Name | Type | Description |
|---|---|---|
| keys | Array | The 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[]
- FloatCurve in the Roblox Creator Documentation
- FloatCurve in the Roblox API Reference