mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
296 lines
8.9 KiB
YAML
296 lines
8.9 KiB
YAML
# This file is automatically generated. Please don't edit it manually.
|
|
# To submit a bug report on the content, see
|
|
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
|
|
|
|
name: SpringConstraint
|
|
type: class
|
|
memory_category: BaseParts
|
|
summary: |
|
|
Simulates spring and damper behavior between two attachments.
|
|
description: |
|
|
A **SpringConstraint** applies a force to its `Class.Attachment|Attachments`
|
|
based on spring and damper behavior. This constraint, along with a
|
|
`Class.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](../../../physics/units.md) to understand how Roblox units
|
|
compare to metric units.
|
|
|
|
#### Free Length
|
|
|
|
`Class.SpringConstraint.FreeLength|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 `Class.SpringConstraint.Damping|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
|
|
|
|
`Class.SpringConstraint.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
|
|
`Class.SpringConstraint.FreeLength|FreeLength`.
|
|
|
|
#### Limits
|
|
|
|
Enabling the `Class.SpringConstraint.LimitsEnabled|LimitsEnabled` property
|
|
exposes the `Class.SpringConstraint.MinLength|MinLength` and
|
|
`Class.SpringConstraint.MaxLength|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.
|
|
code_samples: []
|
|
inherits:
|
|
- Constraint
|
|
descendants: []
|
|
tags: []
|
|
deprecation_message: ''
|
|
properties:
|
|
- name: SpringConstraint.Coils
|
|
summary: |
|
|
The number of coils visualized on the `Class.SpringConstraint`.
|
|
description: |
|
|
The number of coils visualized on the `Class.SpringConstraint`. This can
|
|
only be set between 0 and 8.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Appearance
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.CurrentLength
|
|
summary: |
|
|
The current distance between the constraint's
|
|
`Class.Attachment|Attachments`.
|
|
description: |
|
|
The current distance between the constraint's
|
|
`Class.Attachment|Attachments`.
|
|
code_samples: []
|
|
type: float
|
|
tags:
|
|
- ReadOnly
|
|
- NotReplicated
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Derived
|
|
serialization:
|
|
can_load: false
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.Damping
|
|
summary: |
|
|
Damping constant for the `Class.SpringConstraint`. Multiplied to the
|
|
velocity of the constraint's `Class.Attachment|Attachments` to reduce the
|
|
spring force applied.
|
|
description: |
|
|
Damping constant for the `Class.SpringConstraint`. Multiplied to the
|
|
velocity of the constraint's `Class.Attachment|Attachments` to reduce the
|
|
spring force applied.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Spring
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.FreeLength
|
|
summary: |
|
|
Natural resting length of the spring.
|
|
description: |
|
|
Natural resting length of the spring.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Spring
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.LimitsEnabled
|
|
summary: |
|
|
Sets whether the `Class.SpringConstraint` enforces a minimum and maximum
|
|
length.
|
|
description: |
|
|
Sets whether the `Class.SpringConstraint` enforces a minimum and maximum
|
|
length. If the constraint's `Class.Attachment|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 `Class.SpringConstraint` with another
|
|
constraint that allows restitution at the end of its range, such as a
|
|
`Class.PrismaticConstraint` or `Class.RopeConstraint`.
|
|
code_samples: []
|
|
type: boolean
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Spring
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.MaxForce
|
|
summary: |
|
|
The maximum force the `Class.SpringConstraint` can apply on its
|
|
`Class.Attachment|Attachments`.
|
|
description: |
|
|
The maximum force the `Class.SpringConstraint` can apply on its
|
|
`Class.Attachment|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.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Spring
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.MaxLength
|
|
summary: |
|
|
The maximum separation the SpringConstraint will allow if
|
|
`Class.SpringConstraint.LimitsEnabled|LimitsEnabled` is true.
|
|
description: |
|
|
The maximum separation the `Class.SpringConstraint` will allow if
|
|
`Class.SpringConstraint.LimitsEnabled|LimitsEnabled` is true.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Limits
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.MinLength
|
|
summary: |
|
|
The minimum separation the SpringConstraint will allow if
|
|
`Class.SpringConstraint.LimitsEnabled|LimitsEnabled` is true.
|
|
description: |
|
|
The minimum separation the `Class.SpringConstraint` will allow if
|
|
`Class.SpringConstraint.LimitsEnabled|LimitsEnabled` is true.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Limits
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.Radius
|
|
summary: |
|
|
The visualized radius of the spring's coils.
|
|
description: |
|
|
The visualized radius of the spring's coils.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Appearance
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.Stiffness
|
|
summary: |
|
|
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
|
|
`Class.SpringConstraint.FreeLength|FreeLength`.
|
|
description: |
|
|
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
|
|
`Class.SpringConstraint.FreeLength|FreeLength`.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Spring
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
- name: SpringConstraint.Thickness
|
|
summary: |
|
|
The visualized thickness of the spring's coils.
|
|
description: |
|
|
The visualized thickness of the spring's coils.
|
|
code_samples: []
|
|
type: float
|
|
tags: []
|
|
deprecation_message: ''
|
|
security:
|
|
read: None
|
|
write: None
|
|
thread_safety: ReadSafe
|
|
category: Appearance
|
|
serialization:
|
|
can_load: true
|
|
can_save: true
|
|
capabilities:
|
|
- Physics
|
|
methods: []
|
|
events: []
|
|
callbacks: []
|