Entity Reference Component

The Entity Reference component allows you to track one or more entity IDs that you can conveniently access through script or C++ code during editor mode.


Atom Gem


Entity Reference Component UI

EntityIdReferencesContains a list of entities whose IDs will be tracked.


During editor mode, call the EntityReferenceRequestBus to retrieve the list of entities being referenced by the component. This example uses the O3DE’s Python Console to retrieve a list of entity IDs.

# entityId contains the Entity Reference component.
entityIdReferences = azlmbr.entity.EntityReferenceRequestBus(azlmbr.bus.Event, 'GetEntityReferences', entityId)
for id in entityIdReferences:
# Expected Output: Entity IDs of the referenced entities.
# [3664549435643349363]
# [17340279414445478303]