core.engine.get_entities

Shared

Retrieves all registered entities of a specified category


Syntax

local result = core.engine.get_entities(
    category, 
    streamed = false
)

Parameters

TypeNameDescription
stringcategoryEntity category to query
Refer Entity Types section
booleanstreamedDetermines which entities to include:
• When true - returns only entities currently streamed into the camera frustum
• When false - returns all entities regardless of streaming state

Returns

TypeNameDescription
tableresultA table containing all matching entities of the specified category

Entity Types

Entity TypeAvailabilityStreamable
"database"serverfalse
"database_query"serverfalse
"model"client | servertrue
"camera"clientfalse
"webview"clientfalse
"font"clientfalse
"texture"clientfalse
"svg"clientfalse
"rendertarget"clientfalse
"timer"client | serverfalse
"promise"client | serverfalse
"thread"client | serverfalse

Examples

Prints all entities of a given category
core.engine.iprint(core.engine.get_entities("texture"))
Counts entities of a given category
core.engine.print("info", "Total webviews:", #core.engine.get_entities("webview"))
Counts only streamed-in models
core.engine.print("info", "Streamed models:", #core.engine.get_entities("model", true))

On this page