Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Attachment

Defines a point and orientation relative to an ancestor PVInstance, Bone, or another Attachment.

Member index 18

HistoryMember
731Axis: Vector3
731CFrame: CFrame
731SecondaryAxis: Vector3
731Visible: bool
731WorldAxis: Vector3
731WorldCFrame: CFrame
731WorldSecondaryAxis: Vector3
731GetAxis(): Vector3
648GetConstraints(): Instances
731GetSecondaryAxis(): Vector3
731SetAxis(axis: Vector3): null
731SetSecondaryAxis(axis: Vector3): null
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

Description

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:

  • ParticleEmitters which will emit particles from the attachment's specific position/orientation instead of the BasePart bounds.

  • Light-emitting objects like PointLight and SpotLight which will shine from the attachment's position/orientation instead of the BasePart center.

  • AudioEmitter which will use the attachment's position as the audio's point of emission.

History 154

Members 18

Axis

TypeDefault
Vector31, 0, 0

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).

This property is not replicated. Its interface does not cross the network boundary.

History 7

Tags: [NotReplicated]

CFrame

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1

The CFrame offset of the attachment. Changes to this property will reflect onto the Position and Rotation properties of this object. Similarly, a change to either of those properties will reflect onto this property.

History 10

  • 731 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 726 Change Default of CFrame from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 705 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 705 Change Default of CFrame from CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1) to
  • 702 Change Default of CFrame from to CFrame(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  • 553 Change Default of CFrame from to
  • 550 Change Category of CFrame from Data to Transform
  • 486 Change ThreadSafety of CFrame from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of CFrame from to ReadOnly
  • 235 Add CFrame

GetAxis

Parameters (0)
No parameters.
Returns (1)
Vector3

Returns the value of the attachment's Axis.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work. Axis should be used instead.

History 6

Tags: [Deprecated]

GetConstraints

Parameters (0)
No parameters.
Returns (1)
Instances

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.

History 2

GetSecondaryAxis

Parameters (0)
No parameters.
Returns (1)
Vector3

Returns the value of the attachment's SecondaryAxis.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work. SecondaryAxis should be used instead.

History 6

Tags: [Deprecated]

SecondaryAxis

TypeDefault
Vector30, 1, 0

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).

This property is not replicated. Its interface does not cross the network boundary.

History 7

Tags: [NotReplicated]

SetAxis

Parameters (1)
axisVector3
Returns (1)
null

Sets the value of the attachment's Axis.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work. Axis should be used instead.

History 7

Tags: [Deprecated]

SetSecondaryAxis

Parameters (1)
axisVector3
Returns (1)
null

Sets the value of the attachment's SecondaryAxis.

This function is deprecated. It exists only for backward compatibility, and should not be used for new work. SecondaryAxis should be used instead.

History 7

Tags: [Deprecated]

Visible

TypeDefault
boolfalse

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.

History 6

WorldAxis

TypeDefault
Vector31, 0, 0

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.

This property is not replicated. Its interface does not cross the network boundary.

History 9

Tags: [NotReplicated]

WorldCFrame

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1

The exact CFrame of the attachment in world space coordinates, independent of its parent. The value of this property is equivalent to multiplying the CFrame of the attachment's parent by its own CFrame.

This property is not replicated. Its interface does not cross the network boundary.

History 12

Tags: [NotReplicated]

WorldSecondaryAxis

TypeDefault
Vector30, 1, 0

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.

This property is not replicated. Its interface does not cross the network boundary.

History 9

Tags: [NotReplicated]

Settings