Attachment

Show Deprecated

Attachment defines a point and orientation relative to a parent BasePart. The offset is stored in the CFrame property. The offset can also be set through other properties, such as WorldCFrame.

Attachments are used by several kinds of Constraint and are also valid parents for many objects that are otherwise parented directly to a BasePart, such as:

  • Particle-emitting objects like ParticleEmitter, Fire, etc, emit from the attachment
  • Light-emitting objects like PointLight and SpotLight shine from the attachment
  • Sound will use the attachment as the focal point of the sound

Summary

Properties

The direction of the Attachment's X-Axis, represented as a unit Vector3.

NOT REPLICATED

Represents the CFrame offset of the Attachment.

The orientation of the Attachment relative to the orientation of its parent, in degrees. Rotations are in Z, X, Y order.

NOT REPLICATED

The positional offset of the Attachment, relative to the position and orientation of its parent.

NOT REPLICATED

The direction of the Attachment's Y-Axis, represented as a unit Vector3.

NOT REPLICATED

Toggles the visibility of the Attachment in-experience.

The direction of the Attachment's X-Axis relative to the world, as a unit Vector3 with a length of 1.

NOT REPLICATED

The exact CFrame of the attachment in world-space coordinates.

NOT REPLICATED

The orientation (in degrees) of the attachment relative to the world, rather than the parent of the Attachment.

NOT REPLICATED

The position of the attachment relative to the world, rather than the parent of the Attachment.

NOT REPLICATED

The direction of the Y-Axis of the Attachment, relative to the world, as a unit Vector3 with a length of 1.

NOT REPLICATED

Events

Methods

Properties

Not Replicated

The Axis is the direction of the Attachment's X-Axis, represented as a unit Vector3.

CFrame

The CFrame offset of the Attachment. Changes to this property will reflect onto the Attachment.Position & Attachment.Rotation properties of this object.

Similarly, a change to either of those properties will reflect onto this property.

Orientation

Not Replicated

The orientation of the Attachment relative to the orientation of its parent, in degrees. Rotations are in Z, X, Y order.

Position

Not Replicated

The positional offset of the Attachment, relative to the position and orientation of its parent.

SecondaryAxis

Not Replicated

The direction of the Attachment's Y-Axis, represented as a unit Vector3.

Visible

Toggles the visibility of the Attachment in-experience.

WorldAxis

Not Replicated

The direction of the Attachment's X-Axis relative to the world, as a unit Vector3 with a length of 1.

WorldCFrame

Not Replicated

WorldCFrame describes the exact CFrame of this attachment in the game world, independent of its BasePart parent.

The value of this property is equivalent to multiplying the CFrame of the attachment's parent by its own CFrame:


1local worldCFrame = attachment.CFrame
2if attachment.Parent then
3 worldCFrame = attachment.Parent.CFrame * worldCFrame
4end
5

WorldOrientation

Not Replicated

The orientation (in degrees) of the attachment relative to the world, rather than the parent of the Attachment.

Rotations are in Z, X, Y order.

WorldPosition

Not Replicated

The position of the attachment relative to the world, rather than the parent of the Attachment.

WorldSecondaryAxis

Not Replicated

The direction of the Y-Axis of the Attachment, relative to the world, as a unit Vector3 with a length of 1.

Events

Methods