Margin in CollisionShape creates edge issues

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

There’s an “Margin” option in CollisionShape, for some reason i can’t turn it down to 0, and it causes some unwanted artifacts, I have a simple scene: camera casts ray from mouse position, and a block that snaps to the side of block, everything seems simple but when you hover over the edge of collision shape, this occurs:


Hovered over edge of block, Top side, left top edge

This shouldn’t be in my game. At first I thought it was my issue, but then I dug up and found out that its not, its the margin parameter that is causing it to happen. I stumbled upon a post with this picture attached, which appears to be normals of the collision shape

This is very vital aspect and I can’t simply dismiss it, is there any solution to this?

I don’t think you can turn it off completely (you also don’t want it at zero because that would cause collision problems) but you can set it to 0.001, also 0.8 means .8 of a pixel and since the graphics would not show being 0.8 (they would be rounded towards the cube making 0.8 seem like 0) also I cant see any problems I even opened the image in a new tab and zoomed in.

Merlin1846 | 2020-03-18 14:59

The problem in image is obvious, it snapped to the back, which is an invisible (unreachable) side.

ishidex2 | 2020-04-15 19:15