Menu
Lumberyard
User Guide (Version 1.13)

Attachment (Legacy)

Note

The following component works with the legacy Geppetto system.

The attachment component lets an entity attach to a bone on the skeleton of another entity. Specifically, the transform of the target bone is checked each frame and if the target bone is not found, then the target entity transform origin is followed.

Attachment Component Properties

The Attachment component has the following properties:

Target Entity

Entity to attach to.

Joint Name

Attach to this joint on the target entity. If none is chosen then attach to the target's world transform.

Position Offset

Local position offset from the target in meters.

Rotation Offset

Local rotation offset from the target in degrees.

Attached Initially

Whether to attach to the target upon activation.

EBus Request Bus Interface

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

For more information about using the Event Bus (EBus) interface, see Working with the Event Bus (EBus) System.

Attach

Causes entity to change its attachment target. Entity detaches from its previous target.

Parameters

targetEntityId – ID of entity to attach to.

targetBoneName – Name of bone on entity to attach to. If bone is not found, then attach to target entity's transform origin.

offsetTransform – Attachment's offset from target.

Detach

Causes entity to detach from its target.

Parameters

None

SetAttachmentOffset

Update entity's offset from target.

Parameters

offsetTransform – Attachment's offset from target.

EBus Notification Bus Interface

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

For more information about using the Event Bus (EBus) interface, see Working with the Event Bus (EBus) System.

OnAttached

Indicates that the entity has attached to the target.

Parameters

targetEntityId – ID of the target being attached to.

OnDetached

Indicates that the entity is detaching from its target.

Parameters

targetEntityId – ID of the target being detached from.