Class · inherits Constraint
AlignPosition
Constraint which applies force to move two attachments together, or to move one attachment to a goal position.
About AlignPosition
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.
Properties 11
ApplyAtCenterOfMass
: booleanWhether force is applied to the parent ofAttachment0at that attachment's location, or at the parents' center of mass.When
false(default), force is applied to the parent ofAttachment0at 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. Whentrue, force is applied at the parents' center of mass.ForceLimitMode
: ForceLimitModeDetermines how the constraint force will be limited. Only used ifRigidityEnabledisfalse.Determines how the constraint force will be limited when
RigidityEnabledisfalse. When set toMagnitude, the constraint force will be limited such that the magnitude is less thanMaxForce. When set toPerAxis, the constraint force along each axis will be limited byMaxAxesForce. The axes along which the force will be limited are based on theForceRelativeToproperty.ForceRelativeTo
: ActuatorRelativeToDetermines the axes that the constraint uses to limit the force. Only applies whenRigidityEnabledisfalseandAlignPosition.ForceLimitModeisPerAxis. .Determines the axes that the constraint uses to limit the force. Only applies when
RigidityEnabledisfalseandAlignPosition.ForceLimitModeisPerAxis. When set toWorld, the constraint force is computed in the world reference frame and the force limits specified inMaxAxesForcerefer to the axes of the world coordinate system. When set toAttachment0orAttachment1, the force limits specified inMaxAxesForcerefer to the axes of the specified attachment coordinate system.MaxAxesForce
: Vector3Maximum force along each axis that the constraint can apply to achieve its goal.Maximum force along each axis that the constraint can apply to achieve its goal. Only used if
RigidityEnabledisfalseandForceLimitModeisPerAxis. The axes used to apply to the limit are specified using theForceRelativeToproperty.MaxForce
: floatMaximum force magnitude the constraint can apply to achieve its goal.Maximum force magnitude the constraint can apply to achieve its goal. Only used if
RigidityEnabledisfalseandForceLimitModeisMagnitude.Note that
MaxForce, as well asMaxVelocity, are caps to the force and velocity respectively. The actual scale is determined byResponsiveness.MaxVelocity
: floatMaximum speed the attachments can move when converging.Maximum speed the attachments can move when converging. Only used if
RigidityEnabledisfalse.Note that
MaxVelocity, as well asMaxForce, are caps to the velocity and force respectively. The actual scale is determined byResponsiveness.Mode
: PositionAlignmentModeWhether the constraint uses one or two attachments in calculating its goal.Whether the constraint uses one or two attachments in calculating its goal. By default, this is
TwoAttachment, meaning that the constraint disregardsPositionand attempts to moveAttachment0to the position ofAttachment1.If set to
OneAttachment, the constraint disregardsAttachment1and attempts to moveAttachment0toPosition.Position
: Vector3The position to which the constraint should move itsAttachment0.The position to which the constraint should move its
Attachment0. Only used ifModeis set toOneAttachment, in which caseAttachment1is disregarded.ReactionForceEnabled
: booleanWhether the constraint applies force only toAttachment0, or to both attachments in equal and opposite directions.If
false(default), the constraint only applies force toAttachment0whileAttachment1remains unaffected. Iftrue, the constraint applies force to both attachments in equal and opposite directions.Responsiveness
: floatControls how quickly the constraint reaches its goal. Higher values cause the attachment(s) to align more rapidly.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
: booleanWhether force is dependent on other properties, or if the physics solver reacts as quickly as possible to complete the alignment.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 byMaxForce,MaxVelocity, andResponsiveness. Iftrue, the physics solver reacts as quickly as possible to complete the alignment.
AlignPosition also has every member of Constraint. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.