What it does
Returns the z position of the scene entity with this id or name.
Syntax
EntityZ(entity string) → floatParameters
| Name | Type | Meaning |
|---|---|---|
| entity | string | The entity's id, name or tag. It must match exactly one entity. |
Every form returns
float
The z coordinate, or 0 when no entity or several entities match.
Good to know
- A missing or ambiguous name never stops the program: it returns 0 and writes one warning to the console, once per name.
- This is the position stored on the entity's transform, relative to its parent if it has one.
Example · generated
DO Print(EntityZ("value")) Sync()LOOPEntityZ 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.