PhysicsBody controlled by animation

You don’t have to worry about the performance It’s just a operation that’s necessary for positioning the physics body from the transform node

I described it as a waste of performance because, generally the physics body manipulates the transform node.

And the problem that “body follows one frame later” you mentioned is probably caused by the delay in updating the World Matrix

For resolve this issue try call the computeWorldMatrix before the physics step to all the nodes with the physics body attached

scene.onBeforePhysicsObservable.add(() => {
    colliderMeshes.forEach(mesh => mesh.computeWorldMatrix(true));
});
2 Likes