Objects and hierarchy
Objects are the building blocks of a scene. A player sprite, floor tile, button, invisible trigger, camera, group, and UI label are all objects. The hierarchy shows how those objects are organized and how parent transforms affect children.
Object basics
Every object has:
| Area | Purpose |
|---|---|
| Transform | Position, size, rotation, scale, opacity, and flip state |
| Name | The label shown in hierarchy, inspectors, graphs, and debug tools |
| Art or role | Image, group, UI element, camera, empty helper, or runtime marker |
| Interaction settings | Whether input events can target the object |
| Components | Optional behavior modules such as Health or Collider 2D |
| Variables | Optional object-scoped fields |
| Flow graphs | Optional Object Flow rules |
Name important objects early. Graphs and debugging become much easier when objects are called Player, DoorExit, CoinCounter, or EnemySpawner instead of Sprite 12.
Selecting objects
In the Arrange workspace:
| Gesture | Result |
|---|---|
| Click on the stage | Select the top object under the pointer |
| Drag empty stage | Box-select every object the rubber-band touches |
| Shift+drag empty stage | Add box-select hits to the current multi-selection |
| Click in hierarchy | Select the row's object |
| Ctrl/Cmd+click | Add or remove from multi-selection |
| Shift+click object | Range-select along the hierarchy order |
| Click the scene root | Inspect scene-level settings |
| Esc | Cancel a gesture or clear a focused edit mode |
If an object is hard to select on the stage, select it from the hierarchy. This is common for invisible triggers, small colliders, background art, and deeply nested children.
Parenting and groups
Parenting lets one object carry other objects with it. Move the parent and the children follow.
Common uses:
| Pattern | Example |
|---|---|
| Character group | Body, weapon, shadow, hitbox |
| UI group | Panel, label, icon, button |
| Level chunk | Platform, hazard, pickups |
| Spawn template | Empty parent with child sprites and logic |
Drag objects in the hierarchy to reorder or reparent them. A child keeps its local transform relative to the parent.
Tip: Use empty groups to organize complex scenes. Empty parents are also useful anchor points for spawn positions, camera targets, and visual effects.
Transform editing
The inspector and stage gizmo both edit transforms.
| Field | Notes |
|---|---|
| X / Y | Position on the scene canvas |
| Width / height | Sprite or object bounds |
| Rotation | Degrees around the object's pivot |
| Scale | Relative size multiplier |
| Opacity | Visibility intensity |
| Flip | Mirror art without changing the source asset |
Use inspector fields when you need exact values. Use the stage handles for fast layout.
Layering and draw order
Objects draw according to hierarchy and scene ordering. When objects overlap, reorder them in the hierarchy. For characters and props that must paint as one unit, attach a Sorting Group to the parent and use each Sprite Renderer's render order inside that group.
General rules:
- Put backgrounds near the bottom of the scene tree.
- Put gameplay objects above backgrounds.
- Put UI in the UI workspace (screen space), not as ad-hoc stage sprites, when it should stay readable across sizes.
- Group related visuals under a Sorting Group so their order stays stable.
Inspector workflow
The inspector is where object behavior gets specific.
| Inspector card | Common work |
|---|---|
| Transform | Place and size the object |
| Object | Rename, choose art, toggle visibility and interaction |
| Components | Add or configure behaviors |
| Variables | Define object-local values |
| Motion / Skeleton | Jump to animation setup |
| Prefab actions | Save, update, or revert reusable templates |
With multiple objects selected, shared fields can be edited together. Mixed values indicate that selected objects currently differ.
Prefabs and reusable objects
A prefab is a reusable object template. It can include:
- Child hierarchy
- Art assignments
- Components and fields
- Object variables
- Object Flow graphs
- Motion and skeleton data
Use prefabs for enemies, pickups, projectiles, UI widgets, doors, hazards, and repeated level pieces. Save a configured object as a prefab from the inspector, then place it again from the asset library.
See Prefabs for the deeper reference.
Good hierarchy habits
- Keep important objects named.
- Group repeated structures before saving prefabs.
- Avoid putting global game rules on random scene objects; use Scene Flow instead.
- Keep invisible triggers named by purpose, such as
FallZoneorShopEnterArea. - Put debug-only objects in a clearly named group so they are easy to remove before publishing.