godot: [Bullet] Fast RigidBody always go through walls and Godot Crash because of Collision


Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.


Godot version: Godot 3 RC3

Issue description: Fast moving Rigidbody3D always go through walls the collision is not always detected … even if i make the wall thick and add more invisible walls to it … still go through them

problem number 2 is : when i added a collision to Rigidbody … everything works fine select player mesh and : Create Convex collision sibling … works fine

but when i close the project and i open it again Godot Crash or Close it self

and the way to reopen the project is to open the scene that contain that Collision in a Text editor and remove the line of Collision from there and in this case , this is the line you must remove from “Level.tscn” to open the project

[node name="PlayerCollisionShape" type="CollisionShape" parent="Player" index="1"]

Steps to reproduce: use : apply_impulse with higher value inside rigid body if you set a lower value it will collide well but not for higher value

and this is the project … if it didn’t open for you … remove the line from Level.tscn in Text editor

Minimal reproduction project: FastRigidBody.zip

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 5
  • Comments: 27 (18 by maintainers)

Most upvoted comments

i have updated the “CCD doesn’t work #2228”, let’s work together to make it work well.

@nikitavondel: CCD has been broken/not working for a long time.

Bullet is implemented for 3D, but, from my understanding, the intent is to stick with Godot’s physics for 2D, since it has some custom behaviors (one-way collision, and things like that).

This is not a fix, but is an improvement of the CCD thresholds calculation: #28595

Is necessary to open a issue in the bullet github because the ccd is turned off with any threshold.

@takeontom a workaround can be making your own tunnelling prevention system, but will depend on each case what you can do to make corrections, predictions…

I ran into this problem yesterday. The CCD did not work for my fast objects.

I did some testing, and it seems like the collision detection is working if I increase the object size. For a simple RigidBody Sphere I made the following observations: At a radius of 1.5 and a rigid body speed of 214 it is colliding. If I increase the speed by 1 to 215 it does not work anymore. At a radius of 1.0 and a rigid body speed of 153 it is colliding. If I increase the speed by 1 to 154 it does not work anymore. At a radius of 0.5 (so a width of 1 unit) it is really weird: following speeds (for example) work: 61, 62, 70, 71 while others (eg 60, 72) do not work. I wasn’t able to find a pattern about when it works and when not.

Another thing that I noticed: A Sphere with the radius 0.1 and a speed of 30 can pass through too. I think I have a explanation for this one: In rigid_body_bullet.cpp line 704 the ccd motion threshold is set to 1. (https://github.com/godotengine/godot/blob/master/modules/bullet/rigid_body_bullet.cpp#L700) If I understand physics correct this means that ccd will only be used if the body moves more than 1 unit in the frame. At a physics framerate of 60 FPS this means that ccd is only used for linear velocities greater than 60 (as this means 1 unit per physics frame). So ccd is not used for a sphere with radius 0.1 and a speed of 30. At a speed of 30 the sphere moves 0.5 units per physics frame. The sphere only has a radius of 0.1 (so a width of 0.2) and that means that there is a gap of 0.3 units that are not checked each frame. See the image bug_godot So I think the motion threshold should be calculated based on the smallest possible line through the object (for a sphere this is the radius*2). This would enable CCD also for smaller objects at low speeds, and I think that is what most users will expect from a continuous detection: no tunneling, no matter of the size of the object. I guess this is only a solution for my small and slow object and not for the general not working ccd.

I am not an expert at physics simulation, maybe everything above is wrong. I just thought I would drop my thoughts about it here, maybe it’s helpful.

If there is anything I can do to help (for example testing) that does not involve coding in C++ then I am happy to help as I would like to use CCD in godot.