godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.15k stars 21.17k forks source link

GodotPhysics locks up on Rigidbody3D collision #66220

Closed akien-mga closed 2 years ago

akien-mga commented 2 years ago

Godot version

Godot_v4.0-beta1, may be in 3.5 too

System information

 Windows 10 64-bit, Intel CPU, Vulkan, Nvidia GTX 1060, GodotPhysics     Windows 10 64-bit, Intel CPU, Vulkan, Nvidia GTX 1060 / Nvidia MX 150 (two devices), GodotPhysics

Issue description

Filing this issue on behalf of a user who does not have a GitHub account. Copy pasting the content sent by email, I did not assess if this issue is valid or if it has duplicates myself.


When the attached scene is run, once the two RigidBody3D objects collide the GodotEngine (game) stops responding and must be stopped from the editor.

Important note: The issue only appears to happen when the collision mesh is created using the mesh 'Create Single Convex Collision Sibling'. If the collision mesh is created using the other types of generation the engine appears to run normally. So it is not entirely clear if it is an edge-case issue is with the physics engine or an issue with the collision mesh generation.

Steps to reproduce

Import the attached scene into a new project and run the scene (the screenshots included are just examples showing the engine lockup). The scene was created the following way...

  1. New project.
  2. New scene, add a root 3D node.
  3. Add a RigidBody3D node, add a child MeshInstance, set the mesh to the default new capsule mesh.
  4. Use the 'Create Single Convex Collision Sibling' feature in the editor to create the collision mesh.
  5. Set the gravity variable on the body to zero.
  6. Duplicate the rigid body.
  7. Place the two rigid bodies equal distance apart and set their linear velocity so they directly collide with each other.
  8. Run the scene.

Minimal reproduction project

rigidbody3d_collision_lockup.zip

Zireael07 commented 2 years ago

dupe/related to #48587 ?

ChristianB84 commented 2 years ago

I have a similar issue with meshes created via Mesh.CreateConvexShape. The engine was not quite frozen, but nearly. There was a new frame once every 30s or so. The meshes were not very complex.

ChristianB84 commented 2 years ago

I just found out that it works without issues if I set the second parameter (simplify) to true.

Calinou commented 2 years ago

Duplicate of https://github.com/godotengine/godot/issues/48587 (same cause). This applies to the problem reported by @ChristianB84 as well.