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.
Blocking out a level with shapes
In Arrange, open Shapes above the stage. Choose Rectangle or Ramp, then drag on the stage. Ramp rises right/left changes the slope direction. To draw a Polygon, click its corners in order and press Enter, click its first corner, or use Finish polygon. Polygons must be convex; use several shapes for inward corners. Invalid outlines stay in the draft so you can correct them.
Shapes are solid by default. They render and collide using the same outline, without creating image assets. The Shape 2D inspector controls the fill, Solid, friction and bounce. Add Rigid Body 2D when a shape should move under physics. An enabled Collider 2D provides an explicit collision override.
Select a shape and choose Edit points in Shapes or its inspector. Drag a vertex to reshape it, drag an edge midpoint to add a corner, or select a vertex and press Delete to remove it. Shape drawing and point editing use the stage's Snap setting; hold Cmd/Ctrl to bypass snapping. Esc cancels the current draft; press it again to leave the tool. Done returns to ordinary selection and transforms.
Move, resize, rotate, flip, duplicate and save shapes as prefabs using the same controls as other objects. Each accepted drawing or point gesture is one Undo step.
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.
The floating stage toolbar shows the active tool's name and shortcut. Choose Move (G), Resize (S), Rotate (R), or Transform (A) to combine all three. Focus a transform button and use Left/Right or Home/End to change tools; Tab reaches the separate Pivot, Shapes, and Snap controls.
| Gesture | Result |
|---|---|
| Drag an object or the Move center | Move freely; hold Shift during the drag to constrain to a scene axis |
| Drag a Move arrow | Move along that object's rotated axis; multi-selection uses scene axes |
| Drag a resize corner or edge | Resize with the opposite corner or edge fixed |
| Shift + resize | Keep the original proportions, including when shrinking |
| Hold Alt after starting a resize | Resize from the center; add Shift to keep proportions |
| Drag the round rotation handle | Rotate about the pivot; Shift snaps to 15° increments |
| Hold Cmd/Ctrl during a move | Temporarily bypass grid snapping |
| Esc during a drag | Restore the starting transform without adding an Undo step |
Size, angle, and movement readouts stay upright as the object rotates. Each completed drag is one Undo step. A multi-selection transforms together; selecting a parent and its child does not apply movement twice. The root of a prefab being edited stays pinned to its origin.
Choose Pivot or press P to move the rotation center without moving the artwork or its children. Shift snaps the pivot to the center or edges. Press P again or Esc to leave pivot editing. Group pivots are temporary selection controls; individual object pivots are saved with the object.
Modifier timing matters: Shift/Cmd/Ctrl held before clicking an object changes selection, and Alt held before dragging pans the stage. For constrained body movement, snap bypass, or centered resizing, begin the drag first and then hold the modifier. Shift can be held before grabbing a resize or rotation handle.
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.