Attachment
Attachment : Instance
Overview
An Attachment is an instance that defines a specific position and orientation, typically parented to a BasePart, Bone, or another Attachment.
Its relative position and rotation are set via the CFrame property, with WorldCFrame available for adjustments in absolute coordinates.
This instance integrates with various functionalities beyond mere positioning. For example, a Beam connects two Attachments to create visual effects, and physics-based instances can operate relative to an Attachment’s position, enabling precise control.
Attachments make it easy to configure positioning and interaction points that are challenging to achieve with BaseParts alone, allowing flexible configuration of pivots of various effects or actions.
Properties
CFrame
CFrame
This property represents the offset in position and orientation relative to the parent object.
Code Samples
local Attachment = script.Parent
print(Attachment.CFrame)
WorldCFrame
CFrame
This property represents the absolute position and orientation relative to the game world.
This is calculated by applying the Attachment’s unique offset to the parent object’s position and rotation.
Code Samples
local Attachment = script.Parent
print(Attachment.WorldCFrame)
Axis
Vector3
This property represents the Attachment’s X-axis orientation.
Code Samples
local Attachment = script.Parent
print(Attachment.Axis)
SecondaryAxis
Vector3
This property represents the Attachment’s Y-axis orientation.
Code Samples
local Attachment = script.Parent
print(Attachment.SecondaryAxis)
WorldAxis
Vector3
This property represents the Attachment's X-axis orientation relative to the game world’s coordinate system.
Code Samples
local Attachment = script.Parent
print(Attachment.WorldAxis)
WorldSecondaryAxis
Vector3
This property represents the Attachment's Y-axis orientation relative to the game world’s coordinate system.
Code Samples
local Attachment = script.Parent
print(Attachment.WorldSecondaryAxis)
Methods
GetConstraints
Currently not supported.
Parameters
Return
array
Code Samples
Events
Last updated