RigidBody2D phasing through the floor

Godot Version

4.7.1

Question

Here I have a simple RigidBody2D with a Polygon2D and CollisionShape2D (50x50 rectangle), and a floor which is a StaticBody2D with a world boundary collision shape.

Why does the RigidBody2D momentarily clip through the floor when it lands???

Try setting the RigidBody2D’s continous_cd mode to either Cast Ray or Cast Shape.

The reason it momentarily clips is because the default is discrete collision detection which doesn’t take motion into account for performance reasons. Collisions are only detected once the body overlaps with another collider. It is then subsequently corrected as you can see in your video.

it’s still the same :frowning:

Huh. I thought that would fix it. I admit, I never used 2D in Godot that much, so I just thought that would fix it.

I’ll try to figure it out real quick.

Do you use the stander physics engine?
Have you tried to create a static body with a normal collision shape?
Do you have a physics material atachad to one of the objects?
What is you gravaty set to?

I use this settings on a ball and it is fine.

I just tested continous CD in a blank project, and I’m not seeing anything with very small objects.

I tried changing the collision shape of the static body to a rectangle and removed the physics material which just reduced friction to 0.5 (didn’t change anything either). Lowering the gravity did make the RigidBody2D clip through less but it’s still there.

make the ground a box collider?

what do you mean by that?

do not use world boundery shape for the ground use a box shape.

Nevermind. I do see a very small amount of clipping on my end (with CollisionShape2D as BoxShape or WorldBoundaryShape).

It’s a little hard to see in the GIF, but it’s there.
GodotRigidBody2D-clippingTestStaticBody2D

I can’t say that I see any clipping when the RigidBody2D’s are colliding with each other though. Maybe the interaction between Rigidbody2D and StaticBody2D is exempt from continous CD?

I don’t know.

The platform is thin AF. That’s known to cause issues

Not anymore lol, oh wait that was someone else

ye I said I did that

He’s using a WorldBoundaryShape which should be infinitely big, right? I don’t know this 2D stuff.

it is.

I tried making the floor a frozen RigidBody2D but that did nothing

check project setting physics and try to make the scene from scratch (wich is not a big deal)

how do I do that