Different collision with tilemap sharing the same tileset [GODOT 4.0]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zeludtnecniv

I want to create a tilemap composed of two layers. A front layer with collision and a background layer without collision. This two layer will contain the same tiles.
In Godot 3.5, collision was defined in the tilemap node so I can perform this easily. Now it’s defined in the tilesets and I cannot figure out how to do the same thing.

Can I create a single tilemap node with two layers from the new layer system and be able to disable collision in one of them ?

If not, can you create two tilemap sharing the same tileset but deactivate collision for one of them ?

Thank a lot,

A good question actually! I couldn’t find any easy way to do this, except doing a second tileset without collision (copy and remove physics layer). Could be automated with a script of course…

aXu_AP | 2022-09-18 13:50

I have a work around by creating a tilemap only for contact and make it invisible but it’s not optimal. It work for me because contact polygon are simple in my case and identical for all tile. But it’s pretty weird that collision as change this way, it could be interesting to add collision on/off in the layer menu.

zeludtnecniv | 2022-09-18 14:07