Properties
float
|
The number of coils visualized for the constraint |
float
[ReadOnly]
[NotReplicated]
|
Indicates the current angle, in degrees, of the limiting cone |
float
|
Torsional damping of the spring |
bool
[Hidden]
[Deprecated]
|
Determines whether the angular motion of attachments’ secondary axes is limited |
bool
|
float
|
The max angle, in degrees, of the constraint’s limiting cone |
float
|
Maximum allowable torque provided by the spring |
float
|
The visualization radius of the spring |
float
|
The restitution coefficient of the cone constraint |
float
|
Torsional stiffness of the spring |
Inherited from Constraint: Show
bool
[ReadOnly]
[NotReplicated]
|
Indicates if the constraint is currently active in the world |
Attachment
|
The |
Attachment
|
The |
BrickColor
|
The color of the constraint. |
bool
|
Toggles whether or not this Constraint is enabled. |
bool
|
Toggles the visibility of this Constraint. |
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
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
In the following code sample, two BasePart|bodies are created and an Attachment|attachment is placed on each of them. Next a TorsionSpringConstraint is created to connect the two attachments.
local BodyA=Instance.new("Part", workspace)
BodyA.Size=Vector3.new(1,1,1)
BodyA.Position=Vector3.new(2,1,1)
BodyA.Anchored=true
local BodyB=Instance.new("Part", workspace)
BodyB.Size=Vector3.new(1,1,1)
BodyB.Position=Vector3.new(-2,1,1)
local attachmentA = Instance.new("Attachment", BodyA)
attachmentA.Position=Vector3.new(-1,0,0)
attachmentA.Axis=Vector3.new(-1,0,0)
attachmentA.SecondaryAxis=Vector3.new(0,0,1)
local attachmentB = Instance.new("Attachment", BodyB)
attachmentB.Position=Vector3.new(1,0,0)
attachmentB.Axis=Vector3.new(-1,0,0)
attachmentB.SecondaryAxis=Vector3.new(0,1,0)
-- Create a torsion spring
local torsionSpring= Instance.new("TorsionSpringConstraint")
torsionSpring.Parent = BodyA
torsionSpring.Attachment0=attachmentA
torsionSpring.Attachment1=attachmentB