Properties
int
[ReadOnly]
[NotReplicated]
|
Number of keys in the float curve. |
bool
|
Determines if an |
string
[ReadOnly]
[NotReplicated]
|
A read-only string representing the class this |
int
[Hidden]
[ReadOnly]
[NotReplicated]
[Deprecated]
|
The cost of saving the instance using data persistence. |
string
|
A non-unique identifier of the |
Instance
[NotReplicated]
|
Determines the hierarchical parent of the |
bool
[Hidden]
|
A deprecated property that used to protect |
int64
[Hidden]
[NotReplicated]
|
bool
[Hidden]
[NotReplicated]
[Deprecated]
|
string
[ReadOnly]
[NotReplicated]
[Deprecated]
|
Functions
FloatCurveKey
|
Returns a copy of a key at a given index. |
Array
|
Returns key indices before and after time. |
Array
|
Returns a copy of all the keys in the FloatCurve as a Lua array of FloatCurveKey |
float
|
Samples the float curve at a given time passed as argument. |
Array
|
Adds the key passed as argument to this curve. |
int
|
Removes a given number of Keys starting from a given index. Returns the number of keys that were removed. |
int
|
Resets this curve’s keys using the FloatCurveKey array passed as argument. |
void
|
This function destroys all of an |
Instance
|
Create a copy of an object and all its descendants, ignoring objects that are not |
void
|
Sets the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first descendant found with the given |
Actor
|
Returns the Actor associated with the Instance, usually the first Actor ancestor |
Variant
|
Returns the attribute which has been assigned to the given name |
RBXScriptSignal
|
Returns an event that fires when the given attribute changes |
Dictionary
|
Returns a dictionary of string → variant pairs for each of the |
Objects
|
Returns an array containing all of the |
string
[NotBrowsable]
|
Returns a coded string of the |
Array
[CustomLuaState]
|
Returns an array containing all of the descendants of the instance |
string
|
Returns a string describing the |
RBXScriptSignal
|
Get an event that fires when a given property of an object changes. |
bool
[CustomLuaState]
|
Returns true if an |
bool
|
Returns true if an |
bool
|
Returns true if an |
void
[Deprecated]
|
Sets the object’s Parent to nil, and does the same for all its descendants. |
void
|
Sets the attribute with the given name to the given value |
Instance
[CustomLuaState]
[CanYield]
|
Returns the child of the |
Objects
[Deprecated]
|
Returns an array of the object’s children. |
Instance
[Deprecated]
|
void
[Deprecated]
|
Instance
[Deprecated]
|
Objects
[Deprecated]
|
bool
[Deprecated]
[CustomLuaState]
|
bool
[Deprecated]
|
void
[Deprecated]
|
Events
RBXScriptSignal
|
Fires when the |
RBXScriptSignal
|
Fires whenever an attribute is changed on the |
RBXScriptSignal
|
Fired immediately after a property of an object changes. |
RBXScriptSignal
|
Fires after an object is parented to this |
RBXScriptSignal
|
Fires after a child is removed from this |
RBXScriptSignal
|
Fires after a descendant is added to the |
RBXScriptSignal
|
Fires immediately before a descendant of the |
RBXScriptSignal
|
Fires immediately before the instance is destroyed via |
RBXScriptSignal
[Deprecated]
|
Code Samples
local function createFloatCurve()
local curve = Instance.new("FloatCurve")
local key = FloatCurveKey.new(0, 1) -- creates a key at time 0 and with value 1
curve:InsertKey(key);
local newKeys = {FloatCurveKey.new(1, 4), FloatCurveKey.new(2, 1)}
curve:SetKeys(newKeys);
local allKeys = curve:GetKeys();-- copies all keys in this curve into a lua array.
allKeys[1].Value = 2 -- mutates the value of the first key
curve:SetKeys(allKeys);--commits the changes to the curve.
--Note: InsertKey or SetKeys will run auto tangents for those keys that have auto tangent set to true.
print(allKeys)
return curve
end
local function modifyFloatKeys(curve)
--returns the indices of the keys before and after the sample time = 0.5
local indices = curve:GetKeyIndicesAtTime(1.5)
print(indices[1]) -- left Index, prints 1
print(indices[2]) -- right Index, prints 2
-- changing tangents of the curve segment between the first and second keys
local keys = curve:GetKeys();
keys[indices[1]].RightTangent = 3
keys[indices[2]].LeftTangent = 3
curve:SetKeys(keys)
end