Handling Collision Shapes in TileMap's Scene Collections with CharacterBody2D in Godot 4.x

Godot Version

Godot_v4.2-stable

Question

I’m working through a simple breakout tutorial that was made with Godot 3.x, and when using Godot 4.x I have encountered a challenge related to collision handling with TileMaps. In Godot 3.x, there was a “collision parent” option in the inspector for handling collisions within TileMaps, but this seems to be absent in Godot 4.x.

Here’s the setup:

  1. Tile Creation: I’ve created a number of scenes, each representing a different tile. These tiles are used in a TileMap using a Scene Collection Source.
  2. Collision Nodes: Each of these scenes has a collision node (such as StaticBody2D with CollisionShape2D or CollisionPolygon2).
  3. TileMap Integration: The TileMap node is a child of my main CharacterBody2D node in the player scene.

The issue I’m facing is that the CharacterBody2D does not recognize the collision shapes from the tilemap node. It seems like it’s prompting me to add a direct collision node to it, but doing so would cause conflicts with the existing collision shapes in the TileMap tiles.

In Godot 3.x, the solution was to select the “collision parent” feature, but since this is no longer available in Godot 4.x, I’m at a bit of a loss.