Getting Started (6.0)

This guide walks you through setting up GridPlacement 6.0 (C# runtime) and making your first placement in about 10 minutes.

Prerequisites

  • Godot 4.4+ with .NET 8 support enabled
  • A C# Godot project (not GDScript-only)

1. Install the Plugin

Copy addons/grid_placement/ into your Godot project’s addons/ folder:

1
2
3
4
5
6
7
your-godot-project/
└── addons/
    └── grid_placement/
        ├── Godot/                  ← C# Godot adapter layer
        ├── Core/                   ← Core placement logic (no engine deps)
        ├── ECS/                    ← ECS components and systems
        └── plugin.cfg

Enable the addon in Project → Project Settings → Plugins.

2. Create PlacementContext

PlacementContext is a Godot Resource that owns all placement services. Create one per active runtime:

  1. Create the resource: Right-click in FileSystem → Create New → Resource → search for PlacementContext
  2. Configure it in the Inspector:
    • Assign your TileMapLayer to TargetMap
    • Set grid dimensions via Settings.Grid

3. Wire the Scene Hierarchy

The minimum viable scene:

1
2
3
MainLevel
├── TileMapLayer                    ← Your game level
└── PlacementContext                ← Resource, not a node

For cursor input, add a PlacementInputController node and connect it to the context.

4. Place Your First Building

1
2
3
4
5
6
7
8
9
// Get the context (injected, or via scene path)
var context = GetNode<PlacementContext>("/root/PlacementContext");

// Select a placeable
context.SelectPlaceable(buildingId);

// Move cursor over grid — valid cells highlight green, invalid red
// Press Confirm (Left Click) to place
// Press Cancel (Right Click) to exit

5. Game Feel Hooks

GridPlacement handles validation and state. You handle the feedback. Wire these events to make placement feel satisfying:

Placement Events

1
2
3
context.Events.EntityPlaced += OnPlacementSuccess;
context.Events.EntityDemolished += OnDemolishConfirmed;
context.Events.OccupancyChanged += OnOccupancyChanged;

Manipulation Events

1
2
3
context.ManipulationSignals.MoveStarted += OnMoveStarted;
context.ManipulationSignals.MoveConfirmed += OnMoveConfirmed;
context.ManipulationSignals.MoveCancelled += OnMoveCancelled;

Quick Game Feel Patterns

EffectHow
SoundPlay placement sound on EntityPlaced, error buzz on rejection
Ghost tintGreen when PreviewUpdated.IsValid, red when invalid
Camera bounceSmall upward punch on successful place
TooltipShow rejection reason on invalid preview

See the Composition + Injection guide for full event reference.

6. Demolishable Objects

Objects must be explicitly marked as demolishable. On your placeable scene:

1
2
3
var settings = GetNode<ManipulatableSettings>("Settings");
settings.Demolishable = true;
settings.Rotatable = true;

When targeted, demolishable objects show a green highlight. Set IsProtected = true to prevent demolish even when enabled.

What’s Next?


Last Updated: 2026-05-07