Entities
Updated
Every object in a scene is an entity: a 3D model, a light, a camera, a sound, a video screen, a UI panel, a spawn point. If it is in the scene, it is an entity.
What every entity has
Section titled “What every entity has”| Part | What it is |
|---|---|
| A type | What kind of object it is, such as a primitive mesh, a point light or a UI button. The type decides which components it starts with. |
| A name | How you find it, in the Hierarchy and from scripts with find. Several entities may share a name. |
| An id | A code that belongs to this entity only, kept when the scene is saved and when you rename it. |
| A place in the scene | Its transform: a position, a rotation and a scale, relative to its parent. |
| A parent and children | Entities nest: an entity placed inside another moves, turns and scales with it. Move a car and its wheels move with it. |
| Components | What it looks like and what it does. See Components. |
The hierarchy
Section titled “The hierarchy”Entities form a tree, shown in XR Creator’s Hierarchy panel. A lamp can hold its bulb light; a table can hold the objects on it. Moving the parent moves everything inside it.
Layers
Section titled “Layers”Every entity is on a layer, a numbered group set in XR Creator. A layer lets you treat its entities as one: lock them all so they cannot be picked by accident while you edit, switch them all off, or let clicks pass through them, like a pane of glass in front of a button.
Kinds of entities
Section titled “Kinds of entities”The runtime offers many entity types, grouped by what they are: scene structure (groups and scripts), meshes and models, effects, media (images, video, text, documents), lights, cameras, audio, navigation (spawn points, travel points), interaction, UI, logic and AI agents, and XR. The entity reference lists every type.
Entities in a script
Section titled “Entities in a script”#pragma lifecycle(startup)
function startup() { const door = findEntity('Door'); // look an entity up by name door.setPosition(0, 0, -3); // move it log(door.name, 'is at', door.position.z);}Learn more
Section titled “Learn more”- Entity types: every entity type, by family, in the Scripting API
- Working with entities: working with entities from a script
- Scenes and hierarchy in XR Creator