What it does
Counts the entities of the scene that match an id, a name or a tag.
Syntax
EntityCount(entity string) → integerParameters
| Name | Type | Meaning |
|---|---|---|
| entity | string | The 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()LOOPEntityCount 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.