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
726Axis: Vector3
726CFrame: CFrame
726SecondaryAxis: Vector3
726Visible: bool
726WorldAxis: Vector3
726WorldCFrame: CFrame
726WorldSecondaryAxis: Vector3
726GetAxis(): Vector3
648GetConstraints(): Instances
726GetSecondaryAxis(): Vector3
726SetAxis(axis: Vector3): null
726SetSecondaryAxis(axis: Vector3): null
inherited from Instance
726Archivable: bool
726Capabilities: SecurityCapabilities
726IsInSandbox: bool
726Name: string
726Parent: Instance
726PredictionMode: PredictionMode
726Sandboxed: bool
726UniqueId: 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
726children(): Instances
726clone(): Instance
726destroy(): null
726findFirstChild(name: string, recursive: bool = false): Instance
726getChildren(): Instances
726isDescendantOf(ancestor: Instance): bool
726remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
726childAdded(child: Instance)
inherited from Object
726ClassName: string
726className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
726isA(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 135

Members 18

Axis

TypeDefault
Vector3

Direction of the X axis of the attachment, represented as a unit Vector3.

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

History 6

Tags: [NotReplicated]

CFrame

TypeDefault
CFrame

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 9

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

History 5

Tags: [Deprecated]

GetConstraints

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

Returns a list of Constraints connected to the attachment.

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.

History 5

Tags: [Deprecated]

SecondaryAxis

TypeDefault
Vector3

Direction of the Y axis of the attachment, represented as a unit Vector3.

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

History 6

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.

History 6

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.

History 6

Tags: [Deprecated]

Visible

TypeDefault
bool

Toggles the in-experience visibility of the attachment.

History 5

WorldAxis

TypeDefault
Vector3

Direction of the X axis of the attachment relative to the world, represented as a unit Vector3 with a length of 1.

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

History 8

Tags: [NotReplicated]

WorldCFrame

TypeDefault
CFrame

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 11

Tags: [NotReplicated]

WorldSecondaryAxis

TypeDefault
Vector3

Direction of the Y axis of the attachment relative to the world, represented as a unit Vector3 with a length of 1.

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

History 8

Tags: [NotReplicated]

Settings