This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

Attachment Component

The Attachment component lets an entity attach to a bone on the skeleton of another entity.

Attachment Component Properties

Attachment component properties.

The Attachment component has the following properties.


NameDescription
Target entitySpecifies the character entity that you want to attach.
Joint nameSpecifies the joint that you want to attach to the entity.
Position offsetSpecifies the x, y, and z local position offset from the target bone.
Rotation offsetSpecifies the x, y, and z local rotation offset from the target bone.
Scale offsetSpecifies the x, y, and z local scale offset from the target bone.
Attached initiallySpecifies whether to attach to the target entity automatically.
ScalingSpecifies how the object scaling is determined. You can specify the following values:

EBus Request Bus Interface

Use the following request functions with the event bus (EBus) interface to communicate with other components of your game.

For more information, see Working with the Event Bus (EBus) system.


Function NameDescriptionParametersScriptable
AttachChanges the attachment target for an entity. The entity will detach from its previous target.targetEntityId - ID of the entity in which to attach. targetBoneName - Name of bone in which to attach the entity. If a bone is not found, then attach to target entity’s transform origin. offsetTransform - Attachment’s offset from target.Yes
DetachDetaches the target from the entity.NoneYes
SetAttachmentOffsetUpdate entity’s offset from target.offsetTransform - Attachment’s offset from target.Yes

EBus Notification Bus Interface

Use the following notification functions with the EBus interface to communicate with other components of your game.

For more information, see Working with the Event Bus (EBus) system.


Function NameDescriptionParametersScriptable
OnAttachedIndicates that the entity has attached to the target.targetEntityId - ID of the target in which is being attached.Yes
OnDetachedIndicates that the entity is detaching from its target.targetEntityId - ID of the target in which is being detached.Yes