Move a structure
What this teaches
This scene shows how selection and movement stay separate. It previews a move with GridActionRunner, displays the result, and commits only after you choose a valid destination.
Open and run
Menu path: Tools > Lost Lily > Grid Toolkit > Samples > Open > Tutorials > Move Structure.
Enter Play Mode. Click to select, move the pointer to preview, click again to move, and use Reset to rebuild the starting board.
Try it
- Click the token labelled move.
- Hover an occupied destination and read the rejection.
- Hover an open destination and confirm the preview becomes valid.
- Click the open destination.
- Move the still-selected token again.
Checkpoint
The token leaves its old cell and occupies the chosen open cell. Invalid previews do not move it. The token remains selected after a successful commit. Reset returns both the movable token and the blocker to their authored positions.
How it works
| Scene part | Public system | Responsibility |
|---|---|---|
| Selection controller | Project interaction code | Remembers which structure instance is selected. |
| Move action | GridActions | Describes the requested destination. |
| Action runner | GridActionRunner |
Uses the same policy checks for preview and apply. |
| Board view | GridBoardView | Resolves hits and presents preview intents. |
Try another variation
In a duplicated scene, add another blocker or enlarge the movable footprint, then compare preview diagnostics.
Troubleshooting
| Symptom | Fix |
|---|---|
| Hovering does not show destinations. | Select the token labelled move first. |
| Clicking a destination does nothing. | Read the preview diagnostic and choose an unoccupied in-bounds cell. |
Related
- Structures, footprints, layers, and occupancy
- Actions, transactions, and events
- GridActions
- GridActionRunner
- GridBoardView
Next sample
Continue with Add and remove runtime cells.