-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bullet] KinematicBody (3D) move_and_collide fails to return KinematicCollision with small velocity #62153
Comments
@elim2g Can you reproduce this in any of the 3.5 betas and RCs to determine when the regression started? Also, can you reproduce this after switching the 3D physics engine to GodotPhysics in the Project Settings? |
This issue is isolated to Bullet, I cannot reproduce it with GodotPhysics. Will get back shortly with when the regression first appeared. |
This regression first appears in beta5 (3.5.beta5.official [815f7fe]. beta1 - beta4 behave as expected. beta5 and every RC reliably reproduce the issue. |
Hi, the issue is caused by this commit: 65b3200 Specifically the line in
It appears that in Bullet, with small velocities, it's possible for Hope this helps, thanks |
The mentioned commit 65b3200 causes collisions generated only from recovery not to be reported by godot/modules/bullet/space_bullet.cpp Line 988 in db5550a
allowedCcdPenetration , being equal to the (relatively large) constant 0.04 .
Setting that parameter to |
I would like to add that I'm encountering a similar issue right now in rc4, but instead of being triggered by small movements it's being triggered by using Bullet in combination with a high Physics FPS, such as 120, and the angle of the collision also matters. The lower the Physics FPS or the more direct the collision (as opposed to at a shallow angle) the less likely this problem occurs. (EDIT: I thought it was affecting GodotPhysics too but I retested and I was mistaken, it's only affecting Bullet.) For instance, I have a player character able to shoot pulses from a weapon. At a physics rate of 20 FPS, move_and_collide() does its job at all times, but at 120 FPS if the angle of the pulse's movement relative to the surface it hits is only a difference of about 20 degrees, the pulse will just slide along the surface instead. At 240 FPS physics the pulse needs more than a 40 degree angle of impact to not start sliding! |
Can confirm this is an absolutely game-breaking regression for me. Effectively, move_and_collide almost never returns a result, even though there is a collision. I've attached a sample project here: On frames where there's a collision, the box turns red. What's interesting is that I also tried doing an additional test_move_and_collide() which has a movement LARGER than the margin, and it still fails to collide. If you press space, you can try to jump, but it will only work when on the ground, so you can get a better idea of how often it's not on the ground. I'm not really sure why this change to add I should probably sync more often. 😅 |
Fixed by #64875. |
Problem still exists in 2D of 3.5.1, which includes the #64875 update. Attached is the project above, with 3D objects converted to 2D and the problem present: move_and_collide_problem.zip
As with the OP, the problem does not exist in 3.4.4 Godot Engine v3.5.1.stable.official.6fed1ffa3 - https://godotengine.org |
Godot version
3.5.rc4.official [e047c50]
System information
Win10, GLES3, Bullet Physics
Issue description
When using
move_and_collide
, it will fail to return a KinematicCollision if the collision resulted from a small velocity. This is a regression from the version of Godot I currently use, 3.4.4 stable.I have a KinematicBody with a Cylinder CollisionShape which I will move into a StaticBody with a Cube CollisionShape.
With the following code:
you will never see "Collision" printed to the output. However, if I change that
0.1
to a5.0
, you will see "Collision" printed.I've created a minimal repro project to demonstrate.
Steps to reproduce
Load the provided repro projct.
Press play
Note the cylinder touches the cube and does not produce any output. If you want, you can even breakpoint line 18 in
KinematicBody.gd
and see that the execution never pauses.Now hop into
KinematicBody.gd
and modify the0.1
to be5.0
.Play the project again and note that we now get the expected collision.
Minimal reproduction project
move_and_collide_problem.zip
The text was updated successfully, but these errors were encountered: