Collisionshape cannot exactly cover pixel art

Godot Version

Godot v4.4.stable (4c311cbee)

Question

Did I touch some setting by mistake?
When I stretch the 1 pixel collision shape, the red dot moves away from the collision shape (Fig. 2). I try to pull the collision shape back to cover the pixel art, and the collision shape is always offset by half a pixel (Fig. 3) :rofl:

The position of the collision shape is also snapping to whole numbers, notice Position.x is -1.0, -0.5 in fig 2 and finally back to -1.0.

Your pixel sprite is 13 pixels wide, but that makes it’s midpoint 6.5 pixels, maybe you can not use pixel snapping for collision shapes?

1 Like


Thank you for your answer, but I was able to align it at the beginning. I followed the tutorial video and the video did not have this problem. And I can align it when I open a new project. (As shown in the picture) So I suspect that I touched some setting by mistake, but I can’t remember it.

I found the reason, I opened rendering/2d/snap/snap_2d_transforms_to_pixel。 :joy: