Skip to content

Class

AdjacentToCategoryRule

Generated GDScript class reference for GridPlacement.AdjacentToCategoryRule.

Status
Current
Version
v6.2.1
Source updated
2026-09-24
Generated on
2026-10-22

Rule that requires an object placement to have at least one adjacent cell containing a placed object whose [ScenePlacementEntry.profiles] include the required_profile. Uses AdjacencyEvaluator for shared adjacency logic (converged with AdjacencyRequiredRule in the terrain domain). Object-domain adjacency checks the scene tree for PlaceableInstance components via physics point queries at neighbor cells. Example: a fence placeable tagged "fence" requires at least one adjacent cell occupied by another "fence"-tagged object.

Source: addons/grid_placement/placement/placement_rules/template_rules/adjacent_to_category_rule.gd

Syntax

class AdjacentToCategoryRule extends TileCheckRule

Members

NameKindSummary
required_profilePropertyThe category tag that must be matched by at least one neighboring cell.
min_neighborsPropertyMinimum number of matching neighbor cells required.
include_diagonalPropertyWhether to include diagonal neighbors in the search.
error_messagePropertyDescriptive error message shown when validation fails.
get_supported_actionsMethod
validate_placementMethod