AlignOrientation
Constraint which applies torque to align two attachments, or to align one attachment with a goal orientation.
Memory category | PhysicsParts |
---|
Member index 12
Removed member index 1
History | Member | |
---|---|---|
495 | CoordindateFrame: CFrame |
Description
The AlignOrientation constraint applies torque to align two attachments, or to align one attachment with a goal orientation. As indicated by the name, it only affects the orientation of the attachments, not their position (to align attachments positionally, see AlignPosition).
Torque created by AlignOrientation is applied about the center of mass of the parent of the attachments, or the center of mass of parts rigidly connected to the parents.
When configuring this constraint, it may be helpful to study Roblox Units to understand how Roblox units compare to metric units.
Affected Axes
The axes affected by torque are controlled through the constraint's AlignType property. When set to PrimaryAxisParallel, PrimaryAxisPerpendicular or PrimaryAxisLookAt, torque will only occur when the primary axes become misaligned. Otherwise, the constraint will apply torque about all 3 axes to achieve alignment.
Reactionary Torque
By default, the constraint only applies torque to Attachment0 while Attachment1 remains unaffected. If desired, torque can be applied to both attachments in equal and opposite directions by enabling ReactionTorqueEnabled.
Torque Magnitude
You can configure this constraint to apply the maximum torque that constraints allow through the RigidityEnabled property. When true, the physics solver reacts as quickly as possible to complete the alignment. When false, the torque is determined by MaxTorque, MaxAngularVelocity, and Responsiveness.
Attachment Mode
This constraint can use either one or two attachments in calculating its goal. See Mode for details.
History 50
- 603 Change Default of AlignType from Parallel to AllAxes
- 588 Add LookAtPosition
- 553 Change Default of SecondaryAxis from to Vector3(0, 1, 0)
- 553 Change Default of RigidityEnabled from to false
- 553 Change Default of Responsiveness from to 10
- 553 Change Default of ReactionTorqueEnabled from to false
- 553 Change Default of PrimaryAxisOnly from to false
- 553 Change Default of PrimaryAxis from to Vector3(1, 0, 0)
- 553 Change Default of Mode from to TwoAttachment
- 553 Change Default of MaxTorque from to 10000
- 553 Change Default of MaxAngularVelocity from to INF
- 553 Change Default of CFrame from to
- 553 Change Default of AlignType from to Parallel
- 552 Change Tags of SecondaryAxis from [] to [NotReplicated]
- 552 Change Tags of PrimaryAxis from [] to [NotReplicated]
- 542 Change CanSave of SecondaryAxis from true to false
- 542 Change CanLoad of SecondaryAxis from true to false
- 542 Change CanSave of PrimaryAxis from true to false
- 542 Change CanLoad of PrimaryAxis from true to false
- 495 Remove CoordindateFrame
- 495 Add CFrame
- 494 Add SecondaryAxis
- 494 Add PrimaryAxis
- 494 Add Mode
- 494 Add CoordindateFrame
- 486 Change ThreadSafety of RigidityEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Responsiveness from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ReactionTorqueEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of PrimaryAxisOnly from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxTorque from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MaxAngularVelocity from ReadOnly to ReadSafe
- 486 Change ThreadSafety of AlignType from ReadOnly to ReadSafe
- 462 Change ThreadSafety of RigidityEnabled from to ReadOnly
- 462 Change ThreadSafety of Responsiveness from to ReadOnly
- 462 Change ThreadSafety of ReactionTorqueEnabled from to ReadOnly
- 462 Change ThreadSafety of PrimaryAxisOnly from to ReadOnly
- 462 Change ThreadSafety of MaxTorque from to ReadOnly
- 462 Change ThreadSafety of MaxAngularVelocity from to ReadOnly
- 462 Change ThreadSafety of AlignType from to ReadOnly
- 454 Change MemoryCategory of AlignOrientation from Instances to PhysicsParts
- 452 Change MemoryCategory of AlignOrientation from PhysicsParts to Instances
- 453 Change MemoryCategory of AlignOrientation from Instances to PhysicsParts
- 371 Add AlignType
- 281 Add RigidityEnabled
- 281 Add Responsiveness
- 281 Add ReactionTorqueEnabled
- 281 Add PrimaryAxisOnly
- 281 Add MaxTorque
- 281 Add MaxAngularVelocity
- 281 Add AlignOrientation
Members 12
AlignType
Type | Default | |
---|---|---|
AlignType | AllAxes |
Specifies the desired relationship between the primary axes of Attachment0 and the goal. Available options are AllAxes, PrimaryAxisParallel, PrimaryAxisPerpendicular, and PrimaryAxisLookAt. The constraint will attempt to maintain the specified relationship, as given by the AlignType, by applying torques onto the relevant axes.
Thread safety | ReadSafe |
---|---|
Category | AlignOrientation |
Loaded/Saved | true |
CFrame
Type | Default | |
---|---|---|
CFrame |
The CFrame orientation (translation component ignored) with which the constraint will attempt to match the orientation of Attachment0. Only used when Mode is set to OneAttachment.
Thread safety | ReadSafe |
---|---|
Category | TargetOrientation |
Loaded/Saved | true |
LookAtPosition
Type | Default | |
---|---|---|
Vector3 | 0, 0, 0 |
A Vector3 world space location toward which the primary axis will attempt to align. This is only active when AlignType is set to PrimaryAxisLookAt and Mode is set to OneAttachment.
Thread safety | ReadSafe |
---|---|
Category | TargetOrientation |
Loaded/Saved | false |
History 1
- 588 Add LookAtPosition
MaxAngularVelocity
Type | Default | |
---|---|---|
float | INF |
Maximum angular velocity the constraint can use to reach its goal. Only used if RigidityEnabled is false.
Note that MaxAngularVelocity, as well as MaxTorque, are caps to the angular velocity and torque respectively. The actual scale is determined by Responsiveness.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
History 4
- 553 Change Default of MaxAngularVelocity from to INF
- 486 Change ThreadSafety of MaxAngularVelocity from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MaxAngularVelocity from to ReadOnly
- 281 Add MaxAngularVelocity
MaxTorque
Type | Default | |
---|---|---|
float | 10000 |
Maximum torque the constraint can use to reach its goal. Only used if RigidityEnabled is false.
Note that MaxTorque, as well as MaxAngularVelocity, are caps to the torque and angular velocity respectively. The actual scale is determined by Responsiveness.
Thread safety | ReadSafe |
---|---|
Category | Compliance |
Loaded/Saved | true |
Mode
Type | Default | |
---|---|---|
OrientationAlignmentMode | TwoAttachment |
Whether the constraint uses one or two attachments in calculating its goal. By default, this is TwoAttachment, meaning that the constraint attempts to match the orientation of Attachment0 with the orientation of Attachment1, disregarding CFrame, PrimaryAxis, and SecondaryAxis.
If set to OneAttachment, the constraint disregards Attachment1 and attempts to match the orientation of Attachment0 with the orientation of CFrame, or match the attachment's Axis and SecondaryAxis with the constraint's PrimaryAxis and SecondaryAxis properties respectively.
Thread safety | ReadSafe |
---|---|
Category | AlignmentMode |
Loaded/Saved | true |
History 2
- 553 Change Default of Mode from to TwoAttachment
- 494 Add Mode
PrimaryAxis
Type | Default | |
---|---|---|
Vector3 | 1, 0, 0 |
The direction of the goal's X axis, represented as a unit Vector3. Only used when Mode is OneAttachment.
Thread safety | ReadSafe |
---|---|
Category | TargetOrientation |
Loaded/Saved | false |
History 5
- 553 Change Default of PrimaryAxis from to Vector3(1, 0, 0)
- 552 Change Tags of PrimaryAxis from [] to [NotReplicated]
- 542 Change CanSave of PrimaryAxis from true to false
- 542 Change CanLoad of PrimaryAxis from true to false
- 494 Add PrimaryAxis
PrimaryAxisOnly
Type | Default | |
---|---|---|
bool | false |
Determines how the constraint's axes are affected by torque. If false (default), the constraint will apply torque about all 3 axes to achieve alignment. If true, torque will only occur when the primary axes become misaligned.
Enabling PrimaryAxisOnly also enables the AlignType property.
Thread safety | ReadSafe |
---|---|
Category | AlignOrientation |
Loaded/Saved | true |
History 4
- 553 Change Default of PrimaryAxisOnly from to false
- 486 Change ThreadSafety of PrimaryAxisOnly from ReadOnly to ReadSafe
- 462 Change ThreadSafety of PrimaryAxisOnly from to ReadOnly
- 281 Add PrimaryAxisOnly
ReactionTorqueEnabled
Type | Default | |
---|---|---|
bool | false |
If false (default), the constraint only applies torque to Attachment0 while Attachment1 remains unaffected. If true, the constraint applies torque to both attachments in equal and opposite directions.
Thread safety | ReadSafe |
---|---|
Category | AlignOrientation |
Loaded/Saved | true |
History 4
- 553 Change Default of ReactionTorqueEnabled from to false
- 486 Change ThreadSafety of ReactionTorqueEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ReactionTorqueEnabled from to ReadOnly
- 281 Add ReactionTorqueEnabled
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 torque is dependent on other properties, or if the physics solver reacts as quickly as possible to complete the alignment. If false (default), the torque is determined by MaxTorque, MaxAngularVelocity, and Responsiveness. If true, the physics solver reacts as quickly as possible to complete the alignment.
Thread safety | ReadSafe |
---|---|
Category | AlignOrientation |
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
SecondaryAxis
Type | Default | |
---|---|---|
Vector3 | 0, 1, 0 |
The direction of the goal's Y axis, represented as a unit Vector3. Only used when Mode is OneAttachment.
Thread safety | ReadSafe |
---|---|
Category | TargetOrientation |
Loaded/Saved | false |
History 5
- 553 Change Default of SecondaryAxis from to Vector3(0, 1, 0)
- 552 Change Tags of SecondaryAxis from [] to [NotReplicated]
- 542 Change CanSave of SecondaryAxis from true to false
- 542 Change CanLoad of SecondaryAxis from true to false
- 494 Add SecondaryAxis
Removed members 1
CoordindateFrame
Type | Default | |
---|---|---|
CFrame |
Thread safety | ReadSafe |
---|---|
Category | TargetCoordinateFrame |
Loaded/Saved | true |
History 2
- 495 Remove CoordindateFrame
- 494 Add CoordindateFrame