Removing shapes from a body doesn't work
lonevox opened this issue · 1 comments
lonevox commented
Describe the bug
With GodotPhysics2D I can remove shapes from a body when the shape is collided with via PhysicsServer2D.body_remove_shape()
. Shapes don't seem to be removed properly in Rapier2D.
To Reproduce
Steps to reproduce the behavior:
- Download the example project.
- Run it (the project uses GodotPhysics2D by default). You will see that the shapes are removed when colliding with the floor (the drawn polygons remain to make it easier to see that the body no longer has shapes and falls through the floor as expected).
- Switch the physics engine to Rapier2D. The shapes aren't removed when colliding with the floor, and behave strangely as they would normally tip over (you can see them tip over if you make
destroy_shape_on_collision
false inrigid_body_2d.gd
).
Expected behavior
Rapier2D should behave in the same way as GodotPhysics2D.
Videos
GodotPhysics2D:
godot-physics.mp4
Rapier2D:
rapier.mp4
Environment:
- OS: Windows
- Version: v0.6.21
- Godot Version: v4.3-beta1
- Type: simd single
Example project(zip)
Ughuuu commented
Fix by re-updating the shape indexes after a shape is deleted/removed.