SpringConstraint
Simulates spring and damper behavior between two attachments.
Memory category | PhysicsParts |
---|
Member index 11
Description
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.
History 48
- 553 Change Default of Thickness from to 0.100000001
- 553 Change Default of Stiffness from to 0
- 553 Change Default of Radius from to 0.400000006
- 553 Change Default of MinLength from to 0
- 553 Change Default of MaxLength from to 5
- 553 Change Default of MaxForce from to INF
- 553 Change Default of LimitsEnabled from to false
- 553 Change Default of FreeLength from to 1
- 553 Change Default of Damping from to 0
- 553 Change Default of CurrentLength from to 0
- 553 Change Default of Coils from to 3
- 486 Change ThreadSafety of Thickness from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Stiffness from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Radius from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MinLength from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxLength from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxForce from ReadOnly to ReadSafe
- 486 Change ThreadSafety of LimitsEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of FreeLength from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Damping from ReadOnly to ReadSafe
- 486 Change ThreadSafety of CurrentLength from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Coils from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Thickness from to ReadOnly
- 462 Change ThreadSafety of Stiffness from to ReadOnly
- 462 Change ThreadSafety of Radius from to ReadOnly
- 462 Change ThreadSafety of MinLength from to ReadOnly
- 462 Change ThreadSafety of MaxLength from to ReadOnly
- 462 Change ThreadSafety of MaxForce from to ReadOnly
- 462 Change ThreadSafety of LimitsEnabled from to ReadOnly
- 462 Change ThreadSafety of FreeLength from to ReadOnly
- 462 Change ThreadSafety of Damping from to ReadOnly
- 462 Change ThreadSafety of CurrentLength from to ReadOnly
- 462 Change ThreadSafety of Coils from to ReadOnly
- 454 Change MemoryCategory of SpringConstraint from Instances to PhysicsParts
- 452 Change MemoryCategory of SpringConstraint from PhysicsParts to Instances
- 453 Change MemoryCategory of SpringConstraint from Instances to PhysicsParts
- 261 Add Thickness
- 261 Add Radius
- 261 Add Coils
- 241 Add Stiffness
- 241 Add MinLength
- 241 Add MaxLength
- 241 Add MaxForce
- 241 Add LimitsEnabled
- 241 Add FreeLength
- 241 Add Damping
- 241 Add CurrentLength
- 241 Add SpringConstraint
Members 11
Coils
Type | Default | |
---|---|---|
float | 3 |
The number of coils visualized on the SpringConstraint. This can only be set between 0 and 8.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
CurrentLength
Type | Default | |
---|---|---|
float | 0 |
The current distance between the constraint's Attachments.
Thread safety | ReadSafe |
---|---|
Category | Derived |
Loaded/Saved | false/true |
History 4
- 553 Change Default of CurrentLength from to 0
- 486 Change ThreadSafety of CurrentLength from ReadOnly to ReadSafe
- 462 Change ThreadSafety of CurrentLength from to ReadOnly
- 241 Add CurrentLength
Damping
Type | Default | |
---|---|---|
float | 0 |
Damping constant for the SpringConstraint. Multiplied to the velocity of the constraint's Attachments to reduce the spring force applied.
Thread safety | ReadSafe |
---|---|
Category | Spring |
Loaded/Saved | true |
FreeLength
Type | Default | |
---|---|---|
float | 1 |
Natural resting length of the spring.
Thread safety | ReadSafe |
---|---|
Category | Spring |
Loaded/Saved | true |
History 4
- 553 Change Default of FreeLength from to 1
- 486 Change ThreadSafety of FreeLength from ReadOnly to ReadSafe
- 462 Change ThreadSafety of FreeLength from to ReadOnly
- 241 Add FreeLength
LimitsEnabled
Type | Default | |
---|---|---|
bool | false |
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.
Thread safety | ReadSafe |
---|---|
Category | Spring |
Loaded/Saved | true |
History 4
- 553 Change Default of LimitsEnabled from to false
- 486 Change ThreadSafety of LimitsEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of LimitsEnabled from to ReadOnly
- 241 Add LimitsEnabled
MaxForce
Type | Default | |
---|---|---|
float | INF |
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.
Thread safety | ReadSafe |
---|---|
Category | Spring |
Loaded/Saved | true |
MaxLength
Type | Default | |
---|---|---|
float | 5 |
The maximum separation the SpringConstraint will allow if LimitsEnabled is true.
Thread safety | ReadSafe |
---|---|
Category | Limits |
Loaded/Saved | true |
MinLength
Type | Default | |
---|---|---|
float | 0 |
The minimum separation the SpringConstraint will allow if LimitsEnabled is true.
Thread safety | ReadSafe |
---|---|
Category | Limits |
Loaded/Saved | true |
Radius
Type | Default | |
---|---|---|
float | 0.400000006 |
The visualized radius of the spring's coils.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |
Stiffness
Type | Default | |
---|---|---|
float | 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Spring |
Loaded/Saved | true |
Thickness
Type | Default | |
---|---|---|
float | 0.100000001 |
The visualized thickness of the spring's coils.
Thread safety | ReadSafe |
---|---|
Category | Appearance |
Loaded/Saved | true |