AlignPosition
Constraint which applies force to move two attachments together, or to move one attachment to a goal position.
Memory category | PhysicsParts |
---|
Member index 11
Description
The AlignPosition constraint applies force to move two attachments together, or to move one attachment to a goal position. As indicated by the name, it only affects the position of the attachments, not their orientation (to align attachments by orientation, see AlignOrientation).
When configuring this constraint, it may be helpful to study Roblox Units to understand how Roblox units compare to metric units.
Force Location
By default, force is applied to the parent of Attachment0 at that attachment's location, meaning that if the parent's center of mass is not aligned with the direction of the force, torque will be applied as well as force. Alternatively, force can be applied to the parents' center of mass by toggling on ApplyAtCenterOfMass.
Reactionary Force
By default, the constraint only applies force to Attachment0 while Attachment1 remains unaffected. If desired, force can be applied to both attachments in equal and opposite directions by enabling ReactionForceEnabled.
Force Limits
You can configure this constraint to apply the maximum force that constraints allow through the RigidityEnabled property. When true, the physics solver reacts as quickly as possible to complete the alignment. When false, the force applied by the constraint is limited based on ForceLimitMode, MaxVelocity, and Responsiveness. See ForceLimitMode for further details.
Attachment Mode
This constraint can use either one or two attachments in calculating its goal. See Mode for details.
History 36
- 589 Change Tags of ForceLimitMode from [NotBrowsable] to []
- 578 Add MaxAxesForce
- 578 Add ForceRelativeTo
- 578 Add ForceLimitMode
- 553 Change Default of RigidityEnabled from to false
- 553 Change Default of Responsiveness from to 10
- 553 Change Default of ReactionForceEnabled from to false
- 553 Change Default of Position from to Vector3(0, 0, 0)
- 553 Change Default of Mode from to TwoAttachment
- 553 Change Default of MaxVelocity from to INF
- 553 Change Default of MaxForce from to 10000
- 553 Change Default of ApplyAtCenterOfMass from to false
- 494 Add Position
- 494 Add Mode
- 486 Change ThreadSafety of RigidityEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Responsiveness from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ReactionForceEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxVelocity from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxForce from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ApplyAtCenterOfMass from ReadOnly to ReadSafe
- 462 Change ThreadSafety of RigidityEnabled from to ReadOnly
- 462 Change ThreadSafety of Responsiveness from to ReadOnly
- 462 Change ThreadSafety of ReactionForceEnabled from to ReadOnly
- 462 Change ThreadSafety of MaxVelocity from to ReadOnly
- 462 Change ThreadSafety of MaxForce from to ReadOnly
- 462 Change ThreadSafety of ApplyAtCenterOfMass from to ReadOnly
- 454 Change MemoryCategory of AlignPosition from Instances to PhysicsParts
- 452 Change MemoryCategory of AlignPosition from PhysicsParts to Instances
- 453 Change MemoryCategory of AlignPosition from Instances to PhysicsParts
- 281 Add RigidityEnabled
- 281 Add Responsiveness
- 281 Add ReactionForceEnabled
- 281 Add MaxVelocity
- 281 Add MaxForce
- 281 Add ApplyAtCenterOfMass
- 281 Add AlignPosition
Members 11
ApplyAtCenterOfMass
Type | Default | |
---|---|---|
bool | false |
When false (default), force is applied to the parent of Attachment0 at that attachment's location, meaning that if the parent's center of mass is not aligned with the direction of the force, torque will be applied as well as force. When true, force is applied at the parents' center of mass.
Thread safety | ReadSafe |
---|---|
Category | AlignPosition |
Loaded/Saved | true |
History 4
- 553 Change Default of ApplyAtCenterOfMass from to false
- 486 Change ThreadSafety of ApplyAtCenterOfMass from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ApplyAtCenterOfMass from to ReadOnly
- 281 Add ApplyAtCenterOfMass
ForceLimitMode
Type | Default | |
---|---|---|
ForceLimitMode | Magnitude |
Determines how the constraint force will be limited when RigidityEnabled is false. When set to Magnitude, the constraint force will be limited such that the magnitude is less than MaxForce. When set to PerAxis, the constraint force along each axis will be limited by MaxAxesForce. The axes along which the force will be limited are based on the ForceRelativeTo property.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
History 2
- 589 Change Tags of ForceLimitMode from [NotBrowsable] to []
- 578 Add ForceLimitMode
ForceRelativeTo
Type | Default | |
---|---|---|
ActuatorRelativeTo | World |
Determines the axes that the constraint uses to limit the force. Only applies when RigidityEnabled is false and AlignPosition.ForceLimitMode is PerAxis. When set to World, the constraint force is computed in the world reference frame and the force limits specified in MaxAxesForce refer to the axes of the world coordinate system. When set to Attachment0 or Attachment1, the force limits specified in MaxAxesForce refer to the axes of the specified attachment coordinate system.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
History 1
- 578 Add ForceRelativeTo
MaxAxesForce
Type | Default | |
---|---|---|
Vector3 | 10000, 10000, 10000 |
Maximum force along each axis that the constraint can apply to achieve its goal. Only used if RigidityEnabled is false and ForceLimitMode is PerAxis. The axes used to apply to the limit are specified using the ForceRelativeTo property.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
History 1
- 578 Add MaxAxesForce
MaxForce
Type | Default | |
---|---|---|
float | 10000 |
Maximum force magnitude the constraint can apply to achieve its goal. Only used if RigidityEnabled is false and ForceLimitMode is Magnitude.
Note that MaxForce, as well as MaxVelocity, are caps to the force and velocity respectively. The actual scale is determined by Responsiveness.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
MaxVelocity
Type | Default | |
---|---|---|
float | INF |
Maximum speed the attachments can move when converging. Only used if RigidityEnabled is false.
Note that MaxVelocity, as well as MaxForce, are caps to the velocity and force respectively. The actual scale is determined by Responsiveness.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
History 4
- 553 Change Default of MaxVelocity from to INF
- 486 Change ThreadSafety of MaxVelocity from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MaxVelocity from to ReadOnly
- 281 Add MaxVelocity
Mode
Type | Default | |
---|---|---|
PositionAlignmentMode | TwoAttachment |
Whether the constraint uses one or two attachments in calculating its goal. By default, this is TwoAttachment, meaning that the constraint disregards Position and attempts to move Attachment0 to the position of Attachment1.
If set to OneAttachment, the constraint disregards Attachment1 and attempts to move Attachment0 to Position.
Thread safety | ReadSafe |
---|---|
Category | AlignmentMode |
Loaded/Saved | true |
History 2
- 553 Change Default of Mode from to TwoAttachment
- 494 Add Mode
Position
Type | Default | |
---|---|---|
Vector3 | 0, 0, 0 |
The position to which the constraint should move its Attachment0. Only used if Mode is set to OneAttachment, in which case Attachment1 is disregarded.
Thread safety | ReadSafe |
---|---|
Category | AlignPosition |
Loaded/Saved | true |
ReactionForceEnabled
Type | Default | |
---|---|---|
bool | false |
If false (default), the constraint only applies force to Attachment0 while Attachment1 remains unaffected. If true, the constraint applies force to both attachments in equal and opposite directions.
Thread safety | ReadSafe |
---|---|
Category | AlignPosition |
Loaded/Saved | true |
History 4
- 553 Change Default of ReactionForceEnabled from to false
- 486 Change ThreadSafety of ReactionForceEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ReactionForceEnabled from to ReadOnly
- 281 Add ReactionForceEnabled
Responsiveness
Type | Default | |
---|---|---|
float | 10 |
Controls how quickly the constraint reaches its goal. Higher values cause the attachment(s) to align more rapidly. Value can be between 5 and 200.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
History 4
- 553 Change Default of Responsiveness from to 10
- 486 Change ThreadSafety of Responsiveness from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Responsiveness from to ReadOnly
- 281 Add Responsiveness
RigidityEnabled
Type | Default | |
---|---|---|
bool | false |
Whether force is dependent on other properties, or if the physics solver reacts as quickly as possible to complete the alignment. If false (default), the force is determined by MaxForce, MaxVelocity, and Responsiveness. If true, the physics solver reacts as quickly as possible to complete the alignment.
Thread safety | ReadSafe |
---|---|
Category | AlignPosition |
Loaded/Saved | true |
History 4
- 553 Change Default of RigidityEnabled from to false
- 486 Change ThreadSafety of RigidityEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of RigidityEnabled from to ReadOnly
- 281 Add RigidityEnabled