Collision shape collide with tilemap when should go just under

Godot Version

Godot 4.4.1

Question

I might have missed some simple information on the doc, however, here is my problem:

  1. I have a Character2D with a rectangle collision shape. Height of rectangle is 128px
  2. I have a TileMap with bricks height of 64px, and created a floor 2 bricks above the floor (128px high)
  3. Why, when I walk towards this platform, my character stops walking, as it should go under, is it due to some some of tolerance?
  4. My fix is to have a collision shape of 127.5px height, and that works, bu seems wrong.
  5. Am I missing something?

Collisions are calculated with some margins, they are not precise enough to handle 0.0 gap clearance. There is a safe_margin property on the CharacterBody2D, but you can’t set it to 0.0 and expect it to work properly.

Your solution with lowering the body’s shape by 0.5px seems fine to me. I would leave it in, unless you encounter any further issues due to that in the future.

2 Likes