Description
When a RigidBody is removed inside notifyOnContact the game crashes. This happens because the PhysicsWorld still runs lateUpdate. Adding an if (rb != null) inside the for loop here fixes the issue, but I don't know if that's the proper solution.
To Reproduce
- Add a Haxe trait to a RigidBody
- Add object.remove() inside the RigidBody.notifyOnContact notifier
Expected behavior
To remove an object containing a RigidBody from notifyOnContact without errors.
System
Blender: 3.6.11
Armory: 2024.07
OS: Windows 11 Pro (x64)
Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop
Test File
remove_rb_on_contact.zip
Description
When a
RigidBodyis removed insidenotifyOnContactthe game crashes. This happens because thePhysicsWorldstill runslateUpdate. Adding anif (rb != null)inside theforloop here fixes the issue, but I don't know if that's the proper solution.To Reproduce
Expected behavior
To remove an object containing a RigidBody from notifyOnContact without errors.
System
Blender: 3.6.11
Armory: 2024.07
OS: Windows 11 Pro (x64)
Graphics card: NVIDIA GeForce RTX 3050 Ti Laptop
Test File
remove_rb_on_contact.zip