Grouping Placed Tiles in a TilemapLayer with with Terrain Collisions

Godot Version

4.3

Question

Hi, I’m looking to create a segmenter for my tilemap collisions so that I can group wall tiles (Tilemap Layer terrain tiles) together so that they share health and can be destroyed all at the same time (collisions turned off and sprite changed).

My first try was an editor plugin which I found wasn’t what I wanted to deal with. I’m on my second try now, creating a HurtGroup (Node2D) that contains an GroupArea (area 2d) which then contains a (GroupBounds) collision polygon 2d I can use to draw a box to select the tiles.

The tiles have collision shapes drawn through the tilemap editor which work fine colliding with the player and enemies on layer 1(world), but they don’t get picked up by the get_overlapping_bodies method of the GroupArea (area 2d) which is on layer 5 (Buildings) though I have the mask and layer set to 5 for both the GroupArea and the Tileset.

Here is my code that is attached to my HurtGroup:

extends Node2D

@onready var GroupArea: Area2D = $GroupArea
@onready var GroupBounds: CollisionPolygon2D = $GroupArea/GroupBounds

var tiles: Array = []

func _ready() -> void:
    call_deferred("find_tiles_in_group")

func find_tiles_in_group() -> void:
    tiles = GroupArea.get_overlapping_bodies()
    print("Tiles: ", tiles)

It prints out:
Tiles:

Additional Details:
TilemapLayer and an instance of the GroupArea are siblings

TLDR: Problems with complicated TilemapLayer collisions, grateful for help, open to suggestions.