Getting Started
Use this page to get a clean GridBuilding 5.0.3 setup with the current runtime contract.
1) Add the plugin and confirm paths
- ensure the addon is installed at res://addons/grid_building
- keep the 5.0.3 plugin files together
- confirm your project loads the plugin without missing script/resource errors
2) Create a composition container
Create a GBCompositionContainer resource and make sure its config contains:
settingstemplatesactions
The most important fields plugin users usually configure first are:
config.settings.targetingconfig.settings.buildingconfig.settings.manipulationconfig.settings.placement_rulesconfig.templatesconfig.actions
3) Add the required scene nodes
4) Configure the critical inspector fields
GBInjectorSystem.composition_containerGBLevelContext.target_mapGBLevelContext.objects_parentGBOwner.owner_root
Optional but common:
GBLevelContext.mapsGBInjectorSystem.injection_rootsTargetingShapeCast2D.collision_mask
5) Let the injector wire the scene
Any node that implements resolve_gb_dependencies(container: GBCompositionContainer) will be injected automatically by GBInjectorSystem.
This includes core runtime nodes such as:
BuildingSystemGridTargetingSystemGridPositioner2DTargetingShapeCast2DManipulationSystemManipulationParentGBLevelContextGBOwner- several shipped UI nodes
6) Start building through the system API
Why this matters:
- it sets
selected_placeable - it clears the previous preview
- it resets the manipulation parent when needed
- it switches mode to
BUILD - it creates the new preview and rule setup
7) What happens after build mode starts
GridPositioner2Dfollows mouse/keyboard input and moves to tile centersTargetingShapeCast2Dupdates the current target object- placement rules run against the active preview/indicators
- confirm-build input or explicit build calls commit the placement
8) Common setup mistakes
- missing
GBLevelContext.target_map - missing
GBLevelContext.objects_parent - missing
GBOwner.owner_root - trying to place by mutating state directly instead of calling
enter_build_mode(placeable) - forgetting to configure templates/actions inside
GBConfig - expecting
GridTargetingSystemto own mouse movement instead ofGridPositioner2D