Godot: Annoying space between objects and floor

Created on 27 Jul 2019  路  6Comments  路  Source: godotengine/godot

Godot version:
Godot Engine v3.1.1.stable.offical

OS/device including version:
Windows 10/NVidia Geforce GTX 950M

Issue description:
An annoying space between objects and floor. It seems that objects are floating on the air.

Steps to reproduce:

  • Create a cube mesh as ground and convert it to a Static Body with ConvexPolygonShape
  • Create a cube mesh as object and convert it to RigidBody with ConvexPolygonShape
  • Move cube mesh upper than ground and let it fall
  • After falling you should see an annoying space between object and ground

Minimal reproduction project:
https://drive.google.com/open?id=1c1iP_rovpRpzOm9Nne89iPk3YdABZgBQ

archived discussion physics

Most helpful comment

0.04, leave it there. The space should be small enough to not be noticeable in nearly all cases. Worst case scenario you make the colliders slightly smaller than the mesh.

https://docs.godotengine.org/en/3.1/tutorials/physics/kinematic_character_2d.html This page actually explains why this margin exists.

All 6 comments

If you set a shape's margin to something really low (say, 0.001), the space should be eliminated.

image

image

You'll have to do this for every shape of every body; I don't think there's a way to change them globally. There was some reason for why the default margin value is what it is, but I can't remember it.

The core principles behind Godot physics prohibit colliders from ending a frame in a colliding state. This is the minimum seperation distance. If you make it too low, it will break things.

I confirm that changing margin property eliminate space, but it effects on bouncing of objects (specially bouncing behavior of cone completely change), I don't know which bounce effect is more real and how margin effect on this behavior. Is that correct to change the margin property with this situations?

The core principles behind Godot physics prohibit colliders from ending a frame in a colliding state. This is the minimum seperation distance. If you make it too low, it will break things.

What's your meaning of the minimum seperation distance? 0.04 default value or 0.001 minimum value?
So what's your idea about dealing with this space between objects and floor?

0.04, leave it there. The space should be small enough to not be noticeable in nearly all cases. Worst case scenario you make the colliders slightly smaller than the mesh.

https://docs.godotengine.org/en/3.1/tutorials/physics/kinematic_character_2d.html This page actually explains why this margin exists.

This is actually a duplicate of #27427.

Was this page helpful?
0 / 5 - 0 ratings