EntityCount

Family: Studio · One form

What it does

Counts the entities of the scene that match an id, a name or a tag.

Syntax

EntityCount(entity string) → integer

Parameters

NameTypeMeaning
entitystringThe entity's id, name or tag, as the editor shows it. The match is exact.

Every form returns

integer

The number of matching entities, 0 when none matches.

Example · generated

DO  Print(EntityCount("value"))  Sync()LOOP

EntityCount is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

133 commands in Studio