Skip to content
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] 3D RigidBody collisions with static collision shapes still bumpy #46596

Open
Tracked by #45022
bluecorn745 opened this issue Mar 2, 2021 · 8 comments
Open
Tracked by #45022

Comments

@bluecorn745
Copy link

bluecorn745 commented Mar 2, 2021

Godot version:
3.2.2-stable, 3.2.3-stable, edit: 3.2.4rc3, 3.1-stable

OS/device including version:
Windows 10 20H2, Kubuntu 20.10

Issue description:
When sliding a RigidBody in character mode over a flat static terrain, most often it will bump up into the air at the "shape boundaries"-- e.g. the edges of individual triangles in a trimesh, or the edges of convex shapes, but not the edges of BoxShapes. Much less frequently the RigidBody will get stuck on the edge. The bumpy collision will slightly change the direction of motion as well, for example, I'll be trying to go straight forward but end up 10 degrees or so towards the right. What I expect to see is the RigidBody being able to slide across a flat surface in a straight line.

I've only seen this behavior when using Bullet. (When I switch to GodotPhysics the collision boundaries still seem broken, but in a different way so that's beyond the scope of this issue).

I know this is very similar to #21341, but I'm still having this problem. Increasing the physics step as mentioned there helped slightly but did not eliminate the issue, and I've been using the "smooth trimesh collision" option as well. Hoped this might be fixed in 3.2.3, but having the same issue in both 3.2.2 and 3.2.3.

Steps to reproduce:

  1. Enable "visible collision shapes" in the editor
  2. Create a flat terrain out of trimesh (Many ways to do this, I used a GridMap to repeat a cube shape).
  3. Add a RigidBody in character mode that can be moved around using the keyboard.
  4. Don't forget to add a camera :)
  5. Run the scene and observe the bumpy behavior.

Minimal reproduction project:
IsPhysicsFixed_3_2_3.zip
Make sure "visible collision shapes" is checked. Arrow keys to move, space to jump. Orange is planes with trimesh, red is cubes with trimesh, yellow is cubes with convex shapes, and green is cubes with BoxShapes.

@Calinou
Copy link
Member

Calinou commented Mar 2, 2021

@bluecorn745 Can you test this in 3.2.4rc3?

@drcucaracha
Copy link

hello I tried it and if the same problem with 3.2.4 rc3 and rc4

@bluecorn745
Copy link
Author

@Calinou Yeah, I don't know how to get rc4 but got the same results as drcucaracha in rc3. No change that I could tell.

@Leakbang
Copy link

This issue persists in v3.4.stable.official [206ba70f4]

@SmartySmart702
Copy link

SmartySmart702 commented Feb 22, 2022

Same for 3.4.3 RC 2.

@SmartySmart702
Copy link

SmartySmart702 commented Feb 22, 2022

I hope that its ok to mention UE4s solution here. In UE4 you can set a "Rest Offset" value and its working pretty good. Maybe Godot can have something similar? I dont know how hard it would be to implement but it doesnt sound to complicated.

Screenshot (307)

@SmartySmart702
Copy link

SmartySmart702 commented Feb 22, 2022

I just found out about "physics/3d/smooth_trimesh_collision" and it solved the problem for my project. But as op already said, it will not solve this issue.

@valknor
Copy link

valknor commented Feb 24, 2022

I downloaded Godot_v3.4.3-rc2_x11.64 and found the smooth_trimesh_collision option that Smarty mentioned. It didn't help for my project. The only thing that somewhat mitigates this issue is jacking physics frames to 240. Upping the frames also introduces new problems in physics, and would require a rewrite of my scripts (not to mention increasing hardware usage). I can also report that this problem is slightly less noticeable using Godot Physics instead of Bullet, but it's still there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants