# Attachment

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Subclasses: [Bone](https://rapi.sleaze.dev/classes/Bone.md)
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/Attachment/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/Attachment

Defines a point and orientation relative to an ancestor [`PVInstance`](https://rapi.sleaze.dev/classes/PVInstance.md), [`Bone`](https://rapi.sleaze.dev/classes/Bone.md), or another [`Attachment`](https://rapi.sleaze.dev/classes/Attachment.md).

## Properties

### Visible

```luau
Attachment.Visible: boolean = false
```

- Tags: Read capabilities: Basic

Toggles the in-experience visibility of the attachment.

### Axis

```luau
Attachment.Axis: Vector3 = Vector3.new(1, 0, 0)
```

- Tags: Not replicated, Read capabilities: Basic, Load only, Simulation access

Direction of the **X** axis of the attachment, represented as a unit [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md).

### SecondaryAxis

```luau
Attachment.SecondaryAxis: Vector3 = Vector3.new(0, 1, 0)
```

- Tags: Not replicated, Read capabilities: Basic, Load only, Simulation access

Direction of the **Y** axis of the attachment, represented as a unit [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md).

### WorldAxis

```luau
Attachment.WorldAxis: Vector3 = Vector3.new(1, 0, 0)
```

- Tags: Not replicated, Read capabilities: Basic, Load only, Simulation access

Direction of the **X** axis of the attachment relative to the world, represented as a unit [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) with a length of 1.

### WorldCFrame

```luau
Attachment.WorldCFrame: CFrame = CFrame.identity
```

- Tags: Not replicated, Read capabilities: Basic, Load only, Simulation access

The exact [`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) of the attachment in world space coordinates.

### WorldOrientation

```luau
Attachment.WorldOrientation: Vector3 = Vector3.new(-0, 0, 0)
```

- Tags: Hidden, Not replicated, Read capabilities: Basic, Simulation access

Orientation of the attachment relative to the world rather than its own parent.

### WorldPosition

```luau
Attachment.WorldPosition: Vector3 = Vector3.zero
```

- Tags: Hidden, Not replicated, Read capabilities: Basic, Simulation access

Position of the attachment relative to the world rather than its own parent.

### WorldSecondaryAxis

```luau
Attachment.WorldSecondaryAxis: Vector3 = Vector3.new(0, 1, 0)
```

- Tags: Not replicated, Read capabilities: Basic, Load only, Simulation access

Direction of the **Y** axis of the attachment relative to the world, represented as a unit [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) with a length of 1.

### WorldRotation

```luau
Attachment.WorldRotation: Vector3 = Vector3.new(-0, 0, -0)
```

- Tags: Deprecated, Hidden, Read only, Read capabilities: Basic, Simulation access
- Use instead: [`Attachment.WorldOrientation`](https://rapi.sleaze.dev/classes/Attachment.md)

**Deprecated:** This item has been superseded by [`WorldOrientation`](https://rapi.sleaze.dev/classes/Attachment.md) which should be used in new work.

Rotation of the attachment relative to the world rather than its own parent.

### CFrame

```luau
Attachment.CFrame: CFrame = CFrame.identity
```

- Tags: Read capabilities: Basic, Simulation access

[`CFrame`](https://rapi.sleaze.dev/index/types/CFrame.md) offset of the attachment.

### Orientation

```luau
Attachment.Orientation: Vector3 = Vector3.new(-0, 0, 0)
```

- Tags: Hidden, Not replicated, Read capabilities: Basic, Simulation access

Orientation of the attachment relative to the orientation of its parent.

### Position

```luau
Attachment.Position: Vector3 = Vector3.zero
```

- Tags: Hidden, Not replicated, Read capabilities: Basic, Simulation access

Positional offset of the attachment, relative to the position and orientation of its parent.

### Rotation

```luau
Attachment.Rotation: Vector3 = Vector3.new(-0, 0, -0)
```

- Tags: Deprecated, Hidden, Not replicated, Read capabilities: Basic, Simulation access
- Use instead: [`Attachment.Orientation`](https://rapi.sleaze.dev/classes/Attachment.md)

**Deprecated:** This property is deprecated and should not be used in new work. See [`Orientation`](https://rapi.sleaze.dev/classes/Attachment.md) instead.

Rotation of the attachment relative to the rotation of its parent.

## Methods

### GetConstraints

```luau
Attachment:GetConstraints(): { Instance }
```

- Tags: Capabilities: Basic

Returns a list of `Constraints` connected to the attachment.

Returns: An array of [`Constraint`](https://rapi.sleaze.dev/classes/Constraint.md) objects that are connected to this attachment.

### GetAxis

```luau
Attachment:GetAxis(): Vector3
```

- Tags: Deprecated, Capabilities: Basic
- Use instead: [`Attachment.Axis`](https://rapi.sleaze.dev/classes/Attachment.md)

**Deprecated:** This method is deprecated and should not be used in new work.

Returns the value of the attachment's [`Axis`](https://rapi.sleaze.dev/classes/Attachment.md).

Returns: The direction of the X axis as a unit [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) in the attachment's local space.

### GetSecondaryAxis

```luau
Attachment:GetSecondaryAxis(): Vector3
```

- Tags: Deprecated, Capabilities: Basic
- Use instead: [`Attachment.SecondaryAxis`](https://rapi.sleaze.dev/classes/Attachment.md)

**Deprecated:** This method is deprecated and should not be used in new work.

Returns the value of the attachment's [`SecondaryAxis`](https://rapi.sleaze.dev/classes/Attachment.md).

Returns: The direction of the Y axis as a unit [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) in the attachment's local space.

### SetAxis

```luau
Attachment:SetAxis(axis: Vector3)
```

- Tags: Deprecated, Capabilities: Basic
- Use instead: [`Attachment.Axis`](https://rapi.sleaze.dev/classes/Attachment.md)

**Deprecated:** This method is deprecated and should not be used in new work.

Sets the value of the attachment's [`Axis`](https://rapi.sleaze.dev/classes/Attachment.md).

Parameters:

- `axis`: The [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) to set as the X-axis direction of the attachment.

### SetSecondaryAxis

```luau
Attachment:SetSecondaryAxis(axis: Vector3)
```

- Tags: Deprecated, Capabilities: Basic
- Use instead: [`Attachment.SecondaryAxis`](https://rapi.sleaze.dev/classes/Attachment.md)

**Deprecated:** This method is deprecated and should not be used in new work.

Sets the value of the attachment's [`SecondaryAxis`](https://rapi.sleaze.dev/classes/Attachment.md).

Parameters:

- `axis`: The [`Vector3`](https://rapi.sleaze.dev/index/types/Vector3.md) to set as the Y-axis direction of the attachment.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
