Entity Helpers

Utility functions for finding entities in the scene by name — runtime entity lookup without maintaining manual references.

The EntityUtility namespace provides helper functions for finding entities in the active scene by name. Useful for runtime entity lookup without maintaining manual entity references.

For usage guides and setup examples, see The Basics: GS_Core.


API Reference

FunctionReturnsDescription
GetEntityByName(name)AZ::Entity*Finds an active entity with the given name. Returns nullptr if not found.
GetEntityIdByName(name)AZ::EntityIdFinds an active entity’s ID by name. Returns an invalid EntityId if not found.

Usage Example

#include <GS_Core/Utilities/EntityUtility.h>

// Find an entity by name
AZ::EntityId playerId = GS_Core::EntityUtility::GetEntityIdByName("Player");
if (playerId.IsValid())
{
    // Use the entity
}

See Also

For related resources:


Get GS_Core

GS_Core — Explore this gem on the product page and add it to your project.