Open udit opened 4 years ago
The tunneling issue is being tracked in #9071.
I skimmed through #9071 and I may be wrong but it seems the issue here is a bit different. The RigidBody2D
doesn't completely miss the collision. In fact, it does detect the collision but partially overlaps with the CollisionShape2D
of another body and then bounces back as seen in the above GIF (or in the minimal reproduction project).
If I increase the mass of the smaller RigidBody2D
to a significantly bigger value like 10, then it doesn't overlap with the collision even though it would be falling down at the same speed as before.
The
RigidBody2D
doesn't completely miss the collision. In fact, it does detect the collision but partially overlaps with theCollisionShape2D
of another body and then bounces back
Yeah, but due to static nature of collision detection, it can only check if those shapes are colliding at the current frame. Since simulation is proceeded with fixed physics step, in most cases penetration will occur, so it needs to be corrected. And this correction may introduce momentum to the system, I suppose. Therefore, #9071 could completely prevent penetration from occurring in the first place.
See also my hypothesis at https://github.com/godotengine/godot/issues/52550#issuecomment-925748860.
By the way, setting softness
of the pin joint to 0.1
helps those bodies to stay grounded.
Godot version: 3.2
OS/device including version: Windows 10
Issue description: When a
RigidBody2D
with very small mass (e.g. 0.1) is connected with aPinJoint2D
to anotherRigidBody2D
with a larger mass like (e.g. 100), the heavier body pushes the smaller mass through theCollisionShape2D
of another object that it is collides with and bounces back with even greater momentum. This effect diminishes as you keep increasing the mass of the lighter body.RigidBody2D
should not pass throughCollisionShape2D
of another object and should not bounce back with a greater momentum than before collision.Minimal reproduction project: CollisionBug.zip