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

Crash when removing a RigidBody Object using notifyOnContact #3044

Open
moisesjpelaez opened this issue Sep 13, 2024 · 1 comment
Open

Crash when removing a RigidBody Object using notifyOnContact #3044

moisesjpelaez opened this issue Sep 13, 2024 · 1 comment
Labels
bug This issue describes a bug

Comments

@moisesjpelaez
Copy link
Contributor

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

  1. Add a Haxe trait to a RigidBody
  2. 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

@moisesjpelaez moisesjpelaez added the bug This issue describes a bug label Sep 13, 2024
@Onek8
Copy link
Contributor

Onek8 commented Dec 21, 2024

I remember something similar with the contact array node in a project. I just threw a try catch to prevent the crash directly in the node if you think a try catch is a better solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a bug
Projects
None yet
Development

No branches or pull requests

2 participants