Skip to content

Grid Placement v6.2.2

2D Platformer Placement

Adapt the Getting Started setup to side-view platformer levels: square cells, platformer targeting defaults, and a floor/ceiling build workflow.

Status
Current
Version
v6.2.2
Source updated
2026-10-22
Generated on
2026-10-22

This tutorial adapts the Getting Started setup to a side-view platformer: a square-cell grid you place floors, walls, and props against. If you have not completed Getting Started yet, do that first — this guide only covers what changes for a platformer.

What changes for a platformer

Nothing structural. The five runtime pieces, the scene tree, and the session wiring are identical to Getting Started. A platformer differs in exactly two places:

  1. The TileSet stays square. Platformer levels use ordinary square cells (tile_shape = Square, the default), so the only setting that matters is tile_size matching your level art.
  2. Targeting defaults favor horizontal aiming. The shipped platformer targeting template tunes aim/camera behavior for a side-view camera instead of a top-down one.

1. Configure the TileSet

On your level's TileSet resource:

Property Value
tile_shape Square (default)
tile_size Match your art's cell size, e.g. Vector2i(16, 16)

The plugin snaps to whatever cells your TileMapLayer defines — there is no separate grid-size setting to keep in sync. If placement lands between cells, your tile_size and your art are disagreeing.

2. Use the platformer template bundle

The shipped template set includes a platformer bundle that carries settings, actions, and templates inline:

  • Bundle: res://templates/grid_placement_templates/resources/platformer/platformer_placement_bundle.tres
  • Targeting defaults: res://templates/grid_placement_templates/resources/platformer/targeting_settings.tres

Assign the bundle to PlacementSession.grid_placement_bundle and to GridPlacementHost.grid_placement_bundle, exactly as Getting Started step 4 describes. You can leave settings empty on the session — the bundle's settings apply unless you override them.

Terrain is optional for this tutorial. Leave the bundle's terrain_palette empty unless you use terrain painting.

3. Wire the scene

Use the scene tree from Getting Started section 3 unchanged:

  • PlacementLevelContext.target_map → your platformer TileMapLayer.
  • PlacementLevelContext.objects_parent → a dedicated Node2D for placed objects, never the map itself.
  • Instance the positioner stack from res://templates/grid_placement_templates/grid_positioner/grid_positioner_stack.tscn.
  • Keep a current Camera2D — the 2D commit path resolves through the camera projection and fails closed without one.

4. Place your first platform piece

Create a placeable exactly as Getting Started step 5 describes (packed_scene, display_name, and a profiles entry so the selection UI shows it). Platformer-specific authoring notes:

  • The platformer template bundle includes collision checks, so give the object collision shapes or its placement is rejected.
  • Align the scene root to the cell anchor so pieces tile edge-to-edge; a one-pixel offset shows up as visible seams in a row of platforms.
  • For multi-cell pieces (a long bridge, a wide building), follow 2D Object Scene Setup for footprint and anchor rules.

Learn from the platformer demo

The repository ships a complete platformer reference demo at res://demos/platformer/ — side-view levels, buildable-ground rules, and a working catalog. The demos live only in a repository checkout. A consumer project receives only res://addons/grid_placement/ and res://templates/grid_placement_templates/, so treat the demo as read-only reference material to compare against, not something your project imports from.

The portable equivalent of everything the demo wires up is the platformer template bundle from step 2 plus your own art.

Troubleshooting this genre

  • Placement snaps to the wrong rows — your TileSet.tile_size does not match the level art's cell size.
  • Nothing places at all — check for the missing Camera2D (2D commits fail closed without one) and re-run the diagnostic in Validation.
  • Aim feels wrong in side view — confirm the session is using the platformer targeting template rather than a top-down one.