Skip to content

Crash when removing a RigidBody Object using notifyOnContact  #3044

@moisesjpelaez

Description

@moisesjpelaez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue describes a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions