Skip to main content

Entity query

local entityQuery = game:get('EntityQuery')

Entity query service provides methods to query entities in the scene:

Methods

getFirstEntityByName(name: string): Entity

Queries entities by name and retrieves the first found result:

local entityQuery = game:get('EntityQuery')
local found = entityQuery:getFirstEntityByName("Test")