Cannot add collision to TileMap Tiles

Godot Version

Godot 4.5.1 stable(Android)

Question

I’m creating a 2d platformer game. I created a TileMap node and used it to draw tiles as ground for player to walk on. But right now, they don’t have Collison physics so they keep falling. I tried setting Collison, but I can’t find an option in the Inspector menu or TileSet/TileMap editor anywhere. In the Tile editor, I see a “Physics” drop-down below other drop-down like “Animation”, Rendering” etc. Clicking this “Physics” reveals another drop-down “Physics Layer 0”, and clicking that reveals Linear Velocity and Angular Velocity. But I still don’t see and can’t find Collison option.

Someone please tell me how to add collision in the drawn files from TileMap.

In the Inspector, but it’s part of the TileSet properties:

Add a physics layer here, then you can draw it onto your tiles.

2 Likes

@hyvernox

What to do?

Looks like the physics layer is correctly painted on the tile. Is collision still not working?

1 Like

@hyvernox Nope. It still doesn’t have Collison, the player falls through. I think the tiles in the 2d scene would be highlighted blue if they have Collison.

Probably not the best thing to ask, but if you could kindly do it for me, please I’ll be grateful. Link: Download platformer-game.zip | LimeWire

If you do, also please explain what things you did so in future I can do it myself without crashing out over the whole thing

At least for me, even if “Visible Collision Shapes” are enabled in the debug settings, they are only visible when running the scene, but not in the 2d scene preview. To see them in the editor, setting the TileMapLayer’s “Collision Visibility Mode” to “Force Show” works.

It looks like the physics layer is painted on the tile in your screenshot, but the scene isn’t saved. Did you try to run the scene before closing Godot? If not, are you sure you saved the scene after painting the tile?

1 Like

It’s possible that shapes were drawn in the left painting, but the base tile weren’t clicked on the right side.

1 Like

@22551982 Yeah I’m stupid, that’s exactly what I didn’t do. Thanks for reminding.

Thanks for trying to help too, @hyvernox