Class
SpringConstraint
Simulates spring and damper behavior between two attachments.
A SpringConstraint applies a force to its Attachments
based on spring and damper behavior. This constraint, along with a
CylindricalConstraint, is ideal for building vehicle suspension.
Note that if this constraint attaches one part (A) to another part (B) that is anchored or connected to an anchored part (Z), part A will not be locally simulated when interacting with a player.
When configuring this constraint, it may be helpful to study Roblox Units to understand how Roblox units compare to metric units.
Free Length#
FreeLength defines the natural resting
length of the spring. If the attachments are further apart than the free
length, they are forced together; if the attachments are closer together than
the free length, they are forced apart.
Damping#
The Damping value controls how fast the
spring's oscillation dies down. A value of 0 allows the spring to oscillate
endlessly, while higher values bring the spring to a rest more quickly.
Stiffness#
Stiffness sets the strength of the spring.
Higher values create a spring that responds with more force when its
attachments are closer together or further apart than
FreeLength.
Limits#
Enabling the LimitsEnabled property
exposes the MinLength and
MaxLength values for setting the minimum
and maximum length of the spring. If the spring's attachments reach these
limits, they stop moving apart from one another without restitution.
Properties 11#
Coilsfloat | The number of coils visualized on the SpringConstraint.ReadSafe |
CurrentLengthfloat | The current distance between the constraint's
Attachments.ReadSafeReadOnlyNotReplicated |
Dampingfloat | Damping constant for the SpringConstraint. Multiplied to the
velocity of the constraint's Attachments to reduce the
spring force applied.ReadSafe |
FreeLengthfloat | Natural resting length of the spring.ReadSafe |
LimitsEnabledboolean | Sets whether the SpringConstraint enforces a minimum and maximum
length.ReadSafe |
MaxForcefloat | The maximum force the SpringConstraint can apply on its
Attachments.ReadSafe |
MaxLengthfloat | The maximum separation the SpringConstraint will allow if
LimitsEnabled is true.ReadSafe |
MinLengthfloat | The minimum separation the SpringConstraint will allow if
LimitsEnabled is true.ReadSafe |
Radiusfloat | The visualized radius of the spring's coils.ReadSafe |
Stiffnessfloat | The strength of the spring. The higher this value the more force will be
applied when the attachments are separated a different length than the
FreeLength.ReadSafe |
Thicknessfloat | The visualized thickness of the spring's coils.ReadSafe |
Coils: float#
ReadSafe
The number of coils visualized on the SpringConstraint. This can
only be set between 0 and 8.
CurrentLength: float#
ReadOnlyNotReplicatedReadSafe
The current distance between the constraint's
Attachments.
Damping: float#
ReadSafe
Damping constant for the SpringConstraint. Multiplied to the
velocity of the constraint's Attachments to reduce the
spring force applied.
FreeLength: float#
ReadSafe
Natural resting length of the spring.
LimitsEnabled: boolean#
ReadSafe
Sets whether the SpringConstraint enforces a minimum and maximum
length. If the constraint's Attachments reach these
limits, they will simply stop moving apart from one another without
restitution. If you need restitution or elasticity at the ends of the
range of motion, you can combine a SpringConstraint with another
constraint that allows restitution at the end of its range, such as a
PrismaticConstraint or RopeConstraint.
MaxForce: float#
ReadSafe
The maximum force the SpringConstraint can apply on its
Attachments. Some spring systems can give rise to
forces that grow fast leading to instability. In such cases it is
recommended to set MaxForce to a reasonable value.
MaxLength: float#
ReadSafe
The maximum separation the SpringConstraint will allow if
LimitsEnabled is true.
MinLength: float#
ReadSafe
The minimum separation the SpringConstraint will allow if
LimitsEnabled is true.
Radius: float#
ReadSafe
The visualized radius of the spring's coils.
Stiffness: float#
ReadSafe
The strength of the spring. The higher this value the more force will be
applied when the attachments are separated a different length than the
FreeLength.
Thickness: float#
ReadSafe
The visualized thickness of the spring's coils.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild