How and when to use mesh.freezeWorldMatrix()?

Make sure you update the position/rotation/scaling of your meshes by updating the properties of the position / rotation / scaling and not by replacing them.

That is:

mesh.position.x = 34;

and not:

mesh.position = new BABYLON.Vector3(34, 0, 0);

When you replace one of these properties by a new object, the matrix is recomputed even if frozen.

If you don’t update the position/rotation each frame, calling freeze should be a gain so you should do it.

1 Like