Topic was automatically imported from the old Question2Answer platform.
Asked By
ComanderKai77
Old Version
Published before Godot 3 was released.
Hi,
I have a player - a RigidBody2D - which is falling from a platform.
When he hits the ground he falls “too far” und pushes himself a few pixel out of the ground (StaticBody2D).
Have seen the same behavior with CollisionShape2D set to the predefined concave shapes (rect, capsule).
Ended up using RayShape2D, as it pulls the player body out of the static colliders.
My guess is that physics engine does count your collision and stops the RigidBody2D, but the processing steps are discrete, so you see the bodies overlap.
Edit: Downloaded your source, you have scaled the CollisionShapes. That should always be 1,1
Here you go the sprite was off and you should make a scene for your player. Delete your player and add this to your scene.
Having your player in its own scene makes it easier to zero everything out and keep it zeroed out, like pos. Also, like Ilya said, its best to keep all your collision shapes at a scale of 1,1. Some shapes will act up if they are not. Just adjust the size of the points not the scale.
Make sure that the collision box(es) is covered every single pixel of the sprite. Like that you won’t end up with the player sprite getting inside the ground. Same thing if the collision box is covering too much.