Use this page when you have downloaded Grid Placement and want to place your first object in your own Godot project.
Version note: This guide is for Grid Placement 6.0.0 on Godot 4.5.0 through 4.7. The supported buyer-facing setup path here is 2D placement on
TileMapLayer. New projects should use thePlacement*/GridPlacement*class names. Legacy Grid Building /GB*names are compatibility shims only where they still exist.
If you need the release-support boundary before you start, see 6.0 Surface and Brush Reference. It lists the shipped demos, supported vs advanced/deferred surfaces, terrain/object brush modes, and PlacementSettings.max_terrain_brush_cells.
What You Are Building
By the end, you should have:
- The plugin enabled under
res://addons/grid_placement. - Default input actions installed.
- A
GridPlacementHostin your scene. - A
PlacementSessionconnected to the host. - A
PlacementLevelContextpointing at your groundTileMapLayerand object parent. - A
PlacementOwneron the player or placer node. - A
GridPositioner2Dtracking the target cell. - A simple placeable scene that can be selected and placed.
You do not need a custom inventory, a custom save system, or a full demo-project copy for the first successful placement.
1. Install the Plugin
- Unzip the plugin archive.
- Copy
addons/grid_placementinto your project. - Copy
templates/grid_placement_templatesif you want the starter scenes and UI pieces. - Open Godot.
- Enable Grid Placement in Project Settings -> Plugins.
- Run Project -> Tools -> Grid Placement / Setup Default Input Actions.
- Restart the editor so the Input Map and plugin state refresh cleanly.
Quick check: after restarting, Project Settings -> Input Map should contain the placement actions created by the tool menu.
2. Add the Starter Systems Scene
For a beginner setup, start with the shipped systems template instead of hand-building every node.
Use a starter scene such as:
templates/grid_placement_templates/systems.tscntemplates/grid_placement_templates/systems_isometric.tscnif you are intentionally using the isometric starter path
The important runtime node is GridPlacementHost. It receives placement input and dispatches placement work through a PlacementSession.
Beginner mental model:
GridPlacementHost = the runtime coordinator
PlacementSession = the current player/controller placement state
GridPositioner2D = the cursor/target cell tracker
PlacementLevelContext = the level's target map and object parent
PlacementOwner = the player/controller that owns the placement action
If you make the starter scene local after adding it, you can inspect the wiring directly in the editor.
3. Wire the Level
Add PlacementLevelContext to the level scene, usually near your map/world root.
Assign these inspector fields:
| Field | What to assign |
|---|---|
target_map |
The ground TileMapLayer that placement should target. |
objects_parent |
A Node2D where placed object scenes should be added. |
Common beginner mistake: target_map is the tilemap you click against. objects_parent is the node that receives placed object instances. They are not the same thing.
4. Wire the Player or Placer
Add PlacementOwner to the player, controller, or placer node.
Assign:
| Field | What to assign |
|---|---|
owner_root |
The player/controller root node that represents the actor performing placement. |
Add or instance GridPositioner2D for the human-controlled targeting cursor. The positioner is the node that follows the grid cell under the cursor/controller and feeds targeting state to the session.
If your tiles are larger than the starter template, scale or customize the positioner visuals so the preview matches your tile size. For example, a project using 64x64 tiles should not keep a tiny 16x16-looking positioner sprite unless that is intentional.
5. Configure the Session
A PlacementSession is the per-player/per-controller state object. It holds the selected object or terrain, targeting state, action names, logger, settings, and contexts.
For editor-composed scenes, the starter templates normally wire this through PlacementInjectorSystem.session.
For code-built scenes, call:
host.configure(session)
For per-controller setups, register the controller/session with the host:
host.register_session(controller_node, session, device_id)
Use device_id only when you need per-device input routing. For a basic single-player mouse setup, the default/single session path is enough.
6. Create the First Placeable Object
Create a simple object scene, such as a bush, crate, or building foundation.
Minimum recommended scene shape:
BushRoot (Node2D)
- Sprite2D
- StaticBody2D or Area2D
- CollisionShape2D
Then create a ScenePlacementEntry resource for it:
- Set
packed_sceneto your object scene. - Add a display name/icon if your UI uses them.
- Assign one or more
PlacementProfileresources if you want category behavior, supported tools, or profile-level rules. - Add placement rules only when you need extra checks beyond the starter rules.
For collision-based validation and manipulation targeting, the placed scene must have sensible collision layers. If placement fails with no obvious reason, check collision layers before rewriting plugin code.
7. Add the UI
Use the shipped UI templates for the first pass:
PlaceRouterUI— switches between object placement and terrain painting.PlaceableSelectionUI— displays/selects placeable object entries.TerrainPaletteUI— displays/selects terrain entries when terrain painting is used.PlacementActionLog/PlacementActionBar— optional feedback and action controls.
Put the UI under a CanvasLayer.
Important: large full-screen Control nodes can block mouse input. For HUD panels that should not capture placement clicks, set Mouse Filter to Ignore or Pass. Only buttons and interactive UI controls should consume clicks intentionally.
8. Run the First Placement Test
Run the scene and check this order:
- The UI appears.
- A profile/placeable entry appears.
- Selecting the entry creates or enables a preview.
- Moving the cursor updates the target cell.
- Confirming placement adds an object under
PlacementLevelContext.objects_parent. - The Output panel has no missing-context warnings.
If any step fails, check the Output panel and the Troubleshooting guide before changing code.
Most first-run issues are one of these:
- Plugin was not enabled.
- Default input actions were not installed.
PlacementLevelContext.target_mapis empty.PlacementLevelContext.objects_parentis empty.PlacementOwner.owner_rootis empty.- The positioner is not inside the active session/injection scope.
- A UI
Controlis consuming clicks meant for placement. - Collision layers do not match the placement or targeting rules.
9. Optional: Terrain Painting
For terrain painting, add one TerrainPreview node under the same injected scene scope as the host and target map.
You do not need to add preview layers manually. TerrainPreview creates and manages its own runtime preview layers.
Terrain painting works through terrain entries/palettes and the active session's selected terrain. Start with a single terrain entry before adding brush shapes or multiple palettes.
Terrain brush input flow:
| Brush mode | First working input path |
|---|---|
SINGLE |
Hover a cell, then click/confirm once. |
LINE, RECTANGLE_FILL, RECTANGLE_OUTLINE |
Press/hold, drag, release to commit. |
FLOOD_FILL |
First click anchors the preview region; second click commits; cancel clears the pending preview. |
Large brush operations are capped by PlacementSettings.max_terrain_brush_cells (default 4096, hard ceiling 16384). See 6.0 Surface and Brush Reference for the full matrix.
10. Optional: Manipulation and Refunds
To allow placed objects to be moved, rotated, flipped, or demolished:
- Add a
Manipulatablecomponent to the object scene. - Configure
ManipulatableSettingsfor the operations the object supports. - Make sure the object can be detected by the targeting shapecast/layers.
To refund materials when an object is demolished:
- Configure
RefundServicethrough the supported service/template path. - Set
refund_ratio, such as0.5for half refund. - Point the service at your inventory/container bridge.
- See Refund on Demolish for the full inventory-wiring guide.
Refund support expects an id-keyed inventory bridge. The demo inventory is only a prototyping example.
Demo Node Naming
The shipped demos are also documentation examples. Demo nodes that demonstrate a plugin class_name should use that class name as the node name unless a documented exception exists.
This keeps screenshots, videos, guides, and scene-tree inspection aligned for beginners.
Next Steps
- Placement Workflow
- 6.0 Surface and Brush Reference
- Choosing Terrain vs Objects
- Placement Rules
- Manipulation: Service vs Parent
- Refund on Demolish
- Troubleshooting
- Web Export Guide
Source
docs/v6-0/guides/getting-started.md
Plugin docs root:gdscript/plugins/grid_placement_dev/docs