Tilemap collisions seems to have gaps in between tiles
Asked Answered
P

3

0

Godot Version:

4.1.3.stable

Question:

I created this 2D platformer and used Godot's tilemap system, I painted the collisions on the tiles in the physics layer, as shown below:

The player's collision shape is a capsule:

The collisions work most of the time, but at certain positions (in between tiles?), the player just falls straight through.

Working collision:

Broken collision:

My theory is that the tiles' collisions have some sort of gap in between them since they aren't merged together like a stretched rectangle CollisionShape2D, which I had been using before switching to the tilemap system.

Any idea on how to get around this?
Thanks in advance 😃

Edit:
One bug I forgot to mention is that the enemy, which is the rotating square, is somehow stuck when it was supposed to follow the player, I believe this has to deal with the tile collisions as well:

Prudie answered 16/1 at 10:29 Comment(0)
U
1

Collision is too thin, movement too quick. You could change to CCD in the player and/or provide collision for the 'earth' tiles too.

Undesigned answered 16/1 at 14:19 Comment(0)
P
0

Undesigned

Hey, thanks for the reply! I applied your suggestions,

CCD for player:

And earth tile collisions:

But the issue unfortunately still persists, it's just that now the player doesn't fall all the way through and instead be stuck halfway through:

One bug I forgot to mention is that the enemy, which is the rotating square, is somehow stuck (shown in the GIF above) when it was supposed to follow the player, I believe this has to deal with the tile collisions as well.

Prudie answered 16/1 at 15:5 Comment(0)
P
0

I solved the issue by using CollisionPolygon2D to map the collisions instead.

Prudie answered 17/1 at 10:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.