Object rule: every tile under the object must have the right TileSet custom data. Use it to allow building only on certain ground, such as "buildable" tiles. Set expected_tile_custom_data to the custom data names and values each tile must have, for example { "type": "ground", "variant": "grass" }. Add the rule to GridPlacementSettings.placement_rules for every object, or to an entry's own rules.
Source: addons/grid_placement/placement/placement_rules/template_rules/valid_placement_tile_rule.gd
Syntax
class ValidPlacementTileRule extends TileCheckRuleMembers
| Name | Kind | Summary |
|---|---|---|
expected_tile_custom_data | Property | Custom data names and the values each tile must have. |
settings | Property | Messages shown when the rule fails. Uses defaults when empty. |
setup | Method | |
validate_placement | Method | |
tear_down | Method | |
does_tile_have_valid_data | Method |
Tutorials built on Grid Placement
- Godot multiplayer grid placement: one host, four sessions
- Godot 2D grid building system: paint, place, save
- Godot 3D grid building system: the runtime loop
- Godot 4 grid-building plugins: build mode vs editor tools
- 3D room placement in Godot: build rooms and stack storeys
- 3D grid placement in Godot 4: full setup tutorial
- Snap to a TileMap in Godot: 2D grid placement
- How to make a farming system in Godot
- How to snap objects to a 3D grid in Godot