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

CSGPolygon in mode Path makes RigidBody bounce #59120

Closed
ghost opened this issue Mar 13, 2022 · 4 comments
Closed

CSGPolygon in mode Path makes RigidBody bounce #59120

ghost opened this issue Mar 13, 2022 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 13, 2022

Godot version

3.4.2.stable

System information

Windows 11, GLES3, Intel® Iris® Xe Graphics

Issue description

CSGPolygon in mode Path and with generated Collision makes a RigidBody unexpectedly bounce.

Incorrect.mp4

CSGPolygon in mode Depth and with generated Collision makes a RigidBody correctly smoothly move.

Correct.mp4

Bug does not happen to KinematicBody.

Steps to reproduce

  • Add Node: Path
  • Add Points to Path
  • Add Node: CSGPolygon
  • Set CSGPolygon Property:
    • Mode: Path
    • Assign: Path
    • Use Collision: On
  • Add Node: RigidBody
  • Set RigidBody Property:
    • Mode: Character
  • Add Node to RigidBody: CollisionShape
  • Set CollisionShape Property:
    • Shape: New BoxShape
  • Add Node to RigidBody: MeshInstance
  • Set MeshInstance Property:
    • Shape: New BoxShape
  • Add Script to RigidBody
extends RigidBody

func _integrate_forces(state):
	apply_central_impulse(Vector3.FORWARD / 4)

Minimal reproduction project

Bug.zip

@ghost ghost changed the title CSGPolygon with mode Path makes RigidBody bounce CSGPolygon in mode Path makes RigidBody bounce Mar 13, 2022
@Calinou
Copy link
Member

Calinou commented Mar 13, 2022

Related to #50463. This is likely a duplicate of that issue, unless you can't reproduce this when the CSGPolygon is manually converted to a MeshInstance using a script.

3 things to try:

  • Enable Smooth Trimesh Collision in the Project Settings (only effective for Bullet physics engine).
  • Increase Physics Fps to 180 or 240 in the Project Settings.
  • Switch the 3D physics engine to GodotPhysics in the Project Settings.

@ghost
Copy link
Author

ghost commented Mar 14, 2022

  • Switching the 3D physics engine to GodotPhysics seemed to fix the bug.
    • Until I set CollisionShape to CapsuleShape
    • Set a small radius (0.2)
Incorrect.mp4

Bug does not happen to BoxShape and CapsuleShape with big radius in physics engine GodotPhysics.

  • Increasing Physics FPS doesn't fix the bug.
  • Enabling Smooth Trimesh Collision doesn't seem to fix the bug. It only decreases the amount of bounces.
    • Until I set CollisionShape to CapsuleShape which fixes the bug
Incorrect.mp4

Bug does happen to BoxShape.

Result

  • For BoxShape Collision to work:
    • Physics engine: GodotPhysics
  • For CapsuleShape Collision with small radius to work:
    • Physics engine: Bullet
    • Smooth Trimesh Collision: On

@ghost ghost closed this as completed Mar 14, 2022
@ghost
Copy link
Author

ghost commented Mar 14, 2022

This is likely a duplicate of that issue, unless you can't reproduce this when the CSGPolygon is manually converted to a MeshInstance using a script.

I converted CSGPolygon to MeshInstance using a script and created a trimesh collision from it.

_update_shape()
var mesh = MeshInstance.new()
mesh.mesh = get_meshes()[1]
mesh.create_trimesh_collision()
add_child(mesh)

On CSGPolygon turned off Use Collision .
Bug still persists.

Alternative

  • create_convex_collision() does not create a correct collision.

Convex

  • create_multiple_convex_collisions() does not create a precise collision.

MultiConvex

This issue was closed.
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

2 participants