Class
Attachment
Defines a point and orientation relative to an ancestor PVInstance,
Bone, or another Attachment.
An Attachment defines a point and orientation relative to an ancestor
PVInstance, Bone, or another Attachment. The offset is
stored in the CFrame property. The offset can also
be set through other properties, such as
WorldCFrame.
If no ancestral PVInstance or Attachment exists, then
CFrame and
WorldCFrame are the same.
Attachments are used by several kinds of Constraints and
are also valid alternatives to BasePart as a parent for objects such
as:
ParticleEmitterswhich will emit particles from the attachment's specific position/orientation instead of theBasePartbounds.Light-emitting objects like
PointLightandSpotLightwhich will shine from the attachment's position/orientation instead of theBasePartcenter.AudioEmitterwhich will use the attachment's position as the audio's point of emission.
Properties 13#
AxisVector3 | Direction of the X axis of the attachment, represented as a unit
Vector3.ReadSafeNotReplicated |
CFrameCFrame | CFrame offset of the attachment.ReadSafe |
OrientationVector3 | Orientation of the attachment relative to the orientation of its parent.ReadSafeHiddenNotReplicated |
PositionVector3 | Positional offset of the attachment, relative to the position and orientation of its parent.ReadSafeHiddenNotReplicated |
RotationVector3 | Rotation of the attachment relative to the rotation of its parent.ReadSafeDeprecatedHiddenNotReplicated |
SecondaryAxisVector3 | Direction of the Y axis of the attachment, represented as a unit
Vector3.ReadSafeNotReplicated |
Visibleboolean | Toggles the in-experience visibility of the attachment.ReadSafe |
WorldAxisVector3 | Direction of the X axis of the attachment relative to the world,
represented as a unit Vector3 with a length of 1.ReadSafeNotReplicated |
WorldCFrameCFrame | The exact CFrame of the attachment in world space coordinates.ReadSafeNotReplicated |
WorldOrientationVector3 | Orientation of the attachment relative to the world rather than its own parent.ReadSafeHiddenNotReplicated |
WorldPositionVector3 | Position of the attachment relative to the world rather than its own parent.ReadSafeHiddenNotReplicated |
WorldRotationVector3 | Rotation of the attachment relative to the world rather than its own parent.ReadSafeDeprecatedHiddenReadOnlyNotReplicated |
WorldSecondaryAxisVector3 | Direction of the Y axis of the attachment relative to the world,
represented as a unit Vector3 with a length of 1.ReadSafeNotReplicated |
Axis: Vector3#
NotReplicatedReadSafe
Direction of the X axis of the attachment, represented as a unit
Vector3. Together with
SecondaryAxis, this property defines the
orientation of the attachment. Setting Axis automatically re-projects
SecondaryAxis onto the plane perpendicular to the new axis so the two
always remain orthogonal.
The default value is (1, 0, 0).
CFrame: CFrame#
ReadSafe
Orientation: Vector3#
HiddenNotReplicatedReadSafe
Orientation of the attachment relative to the orientation of its parent. Rotations are in Z, X, Y order.
Position: Vector3#
HiddenNotReplicatedReadSafe
Positional offset of the attachment, relative to the position and
orientation of its parent. This value corresponds to the translational
component of CFrame; changing either property
updates the other. The offset is expressed in the local coordinate space
of the parent BasePart, Bone, or Attachment.
The default value is (0, 0, 0).
Rotation: Vector3#
HiddenNotReplicatedDeprecatedReadSafeDeprecated
Deprecated. This property is deprecated and should not be used in new work. See
Orientation instead.
Rotation of the attachment relative to the rotation of its parent. Rotations are in Z, Y, X order.
SecondaryAxis: Vector3#
NotReplicatedReadSafe
Direction of the Y axis of the attachment, represented as a unit
Vector3. Together with Axis, this
property defines the orientation of the attachment. When set, the value is
projected onto the plane perpendicular to Axis so the two axes always
remain orthogonal; the resulting stored value may therefore differ from
the value you assign.
The default value is (0, 1, 0).
Visible: boolean#
ReadSafe
Toggles the in-experience visibility of the attachment. When set to
true, the attachment renders as a small green sphere at its world
position during gameplay. This is useful for debugging constraint setups
or verifying attachment placement without needing Studio's constraint
detail overlays.
The default value is false.
WorldAxis: Vector3#
NotReplicatedReadSafe
Direction of the X axis of the attachment relative to the world,
represented as a unit Vector3 with a length of 1. This is the
world-space equivalent of Axis, computed by
transforming the local axis through the parent's CFrame.
Setting this property converts the supplied direction into the parent's
local space and updates Axis accordingly.
WorldCFrame: CFrame#
NotReplicatedReadSafe
WorldOrientation: Vector3#
HiddenNotReplicatedReadSafe
Orientation of the attachment relative to the world rather than its own parent. Rotations are in Z, X, Y order.
WorldPosition: Vector3#
HiddenNotReplicatedReadSafe
Position of the attachment relative to the world rather than its own
parent. This is the world-space equivalent of
Position, computed by transforming the local
offset through the parent's CFrame. Setting this property
converts the supplied position into the parent's local space and updates
Position accordingly.
WorldRotation: Vector3#
HiddenReadOnlyNotReplicatedDeprecatedReadSafeDeprecated
Deprecated. This item has been superseded by
WorldOrientation which should be used
in new work.
Rotation of the attachment relative to the world rather than its own parent.
WorldSecondaryAxis: Vector3#
NotReplicatedReadSafe
Direction of the Y axis of the attachment relative to the world,
represented as a unit Vector3 with a length of 1. This is the
world-space equivalent of SecondaryAxis,
computed by transforming the local secondary axis through the parent's
CFrame. Setting this property converts the supplied direction
into the parent's local space and updates SecondaryAxis accordingly.
Methods 5#
| GetAxis | Returns the value of the attachment's Axis.Deprecated |
| GetConstraints | Returns a list of Constraints connected to the
attachment. |
| GetSecondaryAxis | Returns the value of the attachment's
SecondaryAxis.Deprecated |
| SetAxis | Sets the value of the attachment's Axis.Deprecated |
| SetSecondaryAxis | Sets the value of the attachment's
SecondaryAxis.Deprecated |
GetAxis(): Vector3#
DeprecatedDeprecated
Deprecated. This method is deprecated and should not be used in new work.
Returns the value of the attachment's Axis.
GetConstraints(): List<Constraint>#
Returns a list of Constraints that use this attachment
as either Attachment0 or
Attachment1. The returned array is a
snapshot at the time of the call; subsequent changes to constraint
connections are not reflected in a previously returned array.
Returns
List<Constraint>— An array ofConstraintobjects that are connected to this attachment.
GetSecondaryAxis(): Vector3#
DeprecatedDeprecated
Deprecated. This method is deprecated and should not be used in new work.
Returns the value of the attachment's
SecondaryAxis.
SetAxis(axis: Vector3): ()#
DeprecatedDeprecated
Deprecated. This method is deprecated and should not be used in new work.
Sets the value of the attachment's Axis.
Returns
()
SetSecondaryAxis(axis: Vector3): ()#
DeprecatedDeprecated
Deprecated. This method is deprecated and should not be used in new work.
Sets the value of the attachment's
SecondaryAxis.
Returns
()
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