Havoc, ThinInstances & CollisionCallback

Hi team,
Adding additional ThinInstances after creating the physics body,
calling body.updateBodyInstances() fails to update some internal properties used for collisions callback / observable, causes a crash.

Edit; Updated to avoid confusion :slight_smile:

  • Press any key to move the capsule & model into the sphere in front of it.
  • See error in console.
  • Un-Comment line #45 fixes the error.

Traced the error to HavocPlugin._bodies not being updated when instances are being updated rather than created/initiated, assumably when removing instances the map wont be updated either

PR Ref: Update havokPlugin.ts by aWeirdo · Pull Request #13783 · BabylonJS/Babylon.js · GitHub

1 Like

@Cedric @RaananW

Good catch! Adding @carolhmj

2 Likes