appsinacup / godot-rapier-physics

Godot Rapier Physics – 2D and 3D physics engine for the Godot game engine. with better stability, performance, liquids, determinism, state serialization and no ghost collisions.
https://godot.rapier.rs
MIT License
421 stars 22 forks source link

Crash when calling get_contact_collider_object inside _integrate_forces after freeing colliding object #273

Closed AntonBergaker closed 1 month ago

AntonBergaker commented 1 month ago

Describe the bug

Crash when calling get_contact_collider_object inside _integrate_forces on a freed object. This doesn't happen with built in godot physics. Since it crashes already on this function there's also no opportunity to call something like instance_valid() before consuming it.

To Reproduce

Call get_contact_collider_object inside _integrate_forces on a freed object.

Expected behavior

No crash.

Environment:

Example project(zip) physicstest.zip

Please attach a zip with project where issue occurs. Remove the addons folder so that the size is less than 25 mb.