Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annoying space between objects and floor #30861

Closed
siamak-s opened this issue Jul 27, 2019 · 6 comments
Closed

Annoying space between objects and floor #30861

siamak-s opened this issue Jul 27, 2019 · 6 comments

Comments

@siamak-s
Copy link

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

@ghost
Copy link

ghost commented Jul 27, 2019

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.

@TheDuriel
Copy link
Contributor

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.

@siamak-s
Copy link
Author

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?

@siamak-s
Copy link
Author

siamak-s commented Jul 27, 2019

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?

@TheDuriel
Copy link
Contributor

TheDuriel commented Jul 27, 2019

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.

@madmiraal
Copy link
Contributor

This is actually a duplicate of #27427.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants