godot icon indicating copy to clipboard operation
godot copied to clipboard

Ghost collisions with CharacterBody3D (CylinderShape3D) against StaticBody3D (ConcavePolygonShape3D)

Open Awarets opened this issue 1 year ago • 2 comments

Tested versions

Reproducible in v4.2.1.stable.mono.official [b09f793f5]

System information

Godot v4.2.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon (TM) R9 390 Series (Advanced Micro Devices, Inc.; 27.20.20913.2000) - Intel(R) Core(TM) i5-4430 CPU @ 3.00GHz (4 Threads)

Issue description

When a CharacterBody3D with CylinderShape3D collides against particular triangles on a StaticBody3D with ConcavePolygonShape3D, the collision results after invoking MoveAndSlide() and GetSlideCollision() are sometimes extremely incorrect.

The reproduction project includes an example of a CharacterBody3D on the edge of a StaticBody3D, moving only very slightly into it, which causes an extreme shift (The collision has a depth of .244, despite the cylinder only having a radius of .25. This becomes significantly more problematic if collision response is used to control character velocity)

image

Steps to reproduce

Run the example project. The CharacterBody3D is moving into the StaticBody3D at a very low speed, but the collision depth+normal pushes it extremely far to the left, as displayed through the console logs.

Minimal reproduction project (MRP)

CollisionDepthIssue.zip

Awarets avatar Feb 18 '24 04:02 Awarets

Possibly related to #87521 or #77051

Awarets avatar Feb 18 '24 04:02 Awarets

I'm experiencing the same issue. I'm wondering if converting my concave mesh into multiple convex meshes but I'm concerned that might bring about other problems at the seems. Has anyone tried this yet?

sanform avatar Feb 23 '25 21:02 sanform

Try upgrading to 4.4.rc1 and switch the 3D physics engine to Jolt Physics in the Project Settings.

Calinou avatar Feb 25 '25 02:02 Calinou

I saw the fix in 4.4 beta 4 (https://github.com/godotengine/godot/pull/102614), and upgraded because I thought it might help but no dice. Did 4.4 RC 1 have a fix I missed?

sanform avatar Feb 25 '25 04:02 sanform

@sanform Did you enable Jolt Physics explicitly in the Project Settings? It's not the default option in 4.4.

Otherwise no there's no additional physics related change in 4.4.rc1 compared to 4.4.beta4.

akien-mga avatar Feb 25 '25 11:02 akien-mga

This issue has been frustrating to me. I have a super monkey ball type game and the ball collides with every seem connecting triangles which is especially apparent when the ball has less momentum. This occurs on Jolt also.

SaviDaWavi avatar Aug 07 '25 05:08 SaviDaWavi

This issue has been frustrating to me. I have a super monkey ball type game and the ball collides with every seem connecting triangles which is especially apparent when the ball has less momentum. This occurs on Jolt also.

This is a separate issue, which would require something like https://github.com/godotengine/godot/pull/102662 to be implemented in GridMap to be fixed.

Calinou avatar Aug 07 '25 13:08 Calinou

This issue has been frustrating to me. I have a super monkey ball type game and the ball collides with every seem connecting triangles which is especially apparent when the ball has less momentum. This occurs on Jolt also.

This is a separate issue, which would require something like #102662 to be implemented in GridMap to be fixed.

So should I make a separate bug report for it?

SaviDaWavi avatar Aug 07 '25 21:08 SaviDaWavi

So should I make a separate bug report for it?

There's already an issue for it:

  • https://github.com/godotengine/godot/issues/46712

Calinou avatar Aug 07 '25 23:08 Calinou