Chris' Tutorials
Docs/Grid Placement

Class

CollisionTestSetup2D

Generated GDScript class reference for GridPlacement.CollisionTestSetup2D.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

CollisionTestSetup2D [codeblock] var test_setup = CollisionTestSetup2D.new(collision_object, Vector2(16, 16)) if test_setup.validate_setup(): # Use test_setup.rect_collision_test_setups for collision testing pass [/codeblock] Builds collision test parameters for a CollisionObject2D to enable placement indicators to perform accurate collision checks against object geometry. [b]Purpose:[/b] Converts CollisionObject2D shapes into testable RectCollisionTestingSetup instances for collision validation during placement operations. [b]Key Features:[/b] • Creates one RectCollisionTestingSetup per shape owner • Expands test areas using configurable shape_stretch_size • Supports CollisionShape2D and CollisionPolygon2D nodes • Comprehensive error reporting via issues array [b]Quick Start:[/b] [codeblock] var test_setup = CollisionTestSetup2D.new(collision_object, Vector2(16, 16)) if test_setup.validate_setup(): # Use test_setup.rect_collision_test_setups for collision testing pass [/codeblock] [b]Advanced Documentation:[/b] For detailed usage, API reference, and troubleshooting, see: https://gridbuilding.pages.dev/api/v5.0.0/CollisionTestSetup2D [b]Dependencies:[/b] RectCollisionTestingSetup, PlacementGeometryUtils

Source: addons/grid_placement/placement/collsion_test/collision_test_setup_2d.gd

Syntax

class CollisionTestSetup2D extends RefCounted

Members

NameKindSummary
collision_objectPropertyThe CollisionObject2D being analyzed for collision testing.
shape_stretch_sizePropertySize to stretch collision shapes for comprehensive tile coverage. Recommended: Use your tile size (e.g., Vector2(16, 16) for 16x16 tiles). See advanced documentation for detailed sizing guidance.
rect_collision_test_setupsPropertyArray of RectCollisionTestingSetup instances, one per shape owner. Use these setups to perform collision tests for placement indicators.
issuesPropertyIssues discovered during collision test setup. Check this array after initialization to identify configuration problems.
add_issueMethod
free_testing_nodesMethod
validate_setupMethod
no_issuesProperty
create_test_setups_for_collision_ownersMethod
setupsProperty
tile_setProperty
collision_shape_stretch_amountProperty
create_test_setups_from_test_nodeMethod
shapes_by_ownerProperty
setups_dictProperty
resultProperty
owner_test_params_setProperty
shape_owner_idsProperty
shape_owner_nodeProperty
owner_shape_countProperty
owned_shapesProperty
found_shapeProperty
owner_testing_rectProperty
rect_test_parametersProperty
shapeProperty
shape_rectProperty
adjusted_rectProperty
polygonProperty
polygon_rectProperty
adjusted_rectProperty
originProperty
adjusted_rectProperty

Source

addons/grid_placement/placement/collsion_test/collision_test_setup_2d.gd

Plugin docs root:gdscript/plugins/grid_placement_dev/docs