Havok Plugin DisposeBody

Hello all!
I’m having some trouble disposing physics bodies in the Havok engine.
Using havokPlugin.disposeBody(), the console repeatedly logs ‘Syncing transform failed for node sphere: undefined has no properties…’, and the aggregate’s body appears not to be disposed.
I imagine I might just be missing a step here, any help is greatly welcome! Cheers :smiling_face_with_three_hearts:

Recreated :

cc @Cedric and @carolhmj

1 Like

2 possibilities:
simply call

aggregate.body.dispose();

or get the physics engine from the scene and call removeBody

2 Likes

Thanks for the response.
It does seem to work in the Playground, but I still get the syncing transform error in my project.

image

It must be a bug on my end then, perhaps to do with the meshes.

It seems my issue was to do with the physics viewer.
You have to remove any bodies from the viewer before disposing them in the plugin.
Resetting Mesh to original position after physics are applied (with Havok) - Questions - Babylon.js (babylonjs.com)