mozilla / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.

Home Page:https://hubs.mozilla.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BG - Deleting an entity that should trigger an `On Collision Exit` event causes crash

j-conrad opened this issue · comments

Description
I have an empty with a Rigidbody/Shape component on it. There is a behavior graph that looks for On Collision Enter & On Collision Exit events.
If I put a spawned media object into the empty but then delete it, I get the following crashes/errors, although not always and not always the same one:

index.mjs:925 Uncaught Error: bitECS - entity does not exist in the world.

physics-system.js:333 Uncaught TypeError: Cannot read properties of undefined (reading 'collisions')

NOTE: This only occurs as a result of the behavior graph setup. If no On Collision Exit event is there, no errors occur.

To Reproduce
Steps to reproduce the behavior:

  1. Open the attached .blend file
  2. Note the graph on the Empty object with the Rigidbody/Shape components
  3. Run in Hubs
  4. Spawn in 2d or 3d media and drop it inside the object (atop the hexagon).
  5. Hold spacebar and delete the object
  6. Crash (if not, try again)

Expected behavior
The entity should be removed and should also trigger any On Collision Exit events. This is integral for things like keeping count of items in a trigger.

Hardware

  • Device: Desktop
  • OS: Windows
  • Browser: Chrome

ColliderDeletion_bug.zip