Class
AlignOrientation
Constraint which applies torque to align two attachments, or to align one attachment with a goal orientation.
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.
Properties 12#
AlignTypeAlignType | The constraint's axis alignment type.ReadSafe |
CFrameCFrame | The CFrame orientation with which the constraint will attempt
to match the orientation of Attachment0.ReadSafe |
LookAtPositionVector3 | A Vector3 world space location toward which the primary axis
will attempt to align.ReadSafeNotReplicated |
MaxAngularVelocityfloat | Maximum angular velocity the constraint can use to reach its goal.ReadSafe |
MaxTorquefloat | Maximum torque the constraint can use to reach its goal.ReadSafe |
ModeOrientationAlignmentMode | Whether the constraint uses one or two attachments in calculating its goal.ReadSafe |
PrimaryAxisVector3 | The direction of the goal's X axis, represented as a unit
Vector3.ReadSafeNotReplicated |
PrimaryAxisOnlyboolean | Determines how the constraint's axes are affected by torque.ReadSafeDeprecated |
ReactionTorqueEnabledboolean | Whether the constraint applies torque only to
Attachment0, or to both attachments in
equal and opposite directions.ReadSafe |
Responsivenessfloat | Controls how quickly the constraint reaches its goal. Higher values cause the attachment(s) to align more rapidly.ReadSafe |
RigidityEnabledboolean | Whether torque is dependent on other properties, or if the physics solver reacts as quickly as possible to complete the alignment.ReadSafe |
SecondaryAxisVector3 | The direction of the goal's Y axis, represented as a unit
Vector3.ReadSafeNotReplicated |
AlignType: AlignType#
ReadSafe
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.
CFrame: CFrame#
ReadSafe
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.
LookAtPosition: Vector3#
NotReplicatedReadSafe
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.
MaxAngularVelocity: float#
ReadSafe
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.
MaxTorque: float#
ReadSafe
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.
Mode: OrientationAlignmentMode#
ReadSafe
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.
PrimaryAxis: Vector3#
NotReplicatedReadSafe
The direction of the goal's X axis, represented as a unit
Vector3. Only used when Mode is
OneAttachment.
PrimaryAxisOnly: boolean#
ReadSafeDeprecated
Deprecated. This property is deprecated. Depending on your usage case, set
AlignType directly to
PrimaryAxisParallel,
PrimaryAxisPerpendicular or
PrimaryAxisLookAt instead.
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.
ReactionTorqueEnabled: boolean#
ReadSafe
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.
Responsiveness: float#
ReadSafe
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.
RigidityEnabled: boolean#
ReadSafe
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.
SecondaryAxis: Vector3#
NotReplicatedReadSafe
The direction of the goal's Y axis, represented as a unit
Vector3. Only used when Mode is
OneAttachment.
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