Imported mesh scaling not working

I want to change the scale of the imported mesh. This works in the playground simplified example using either:

meshes[0].scaling = new BABYLON.Vector3(1.25, 0.25, 0.25);
meshes[0].scaling.x = .5;

But it won’t work in my local solution. I wondered if there could be some kind of conflict or something I’m missing.

Thank you!

That will be hard to tell for us if you can’t reproduce the problem with a playground…

Maybe try to call computeWorldMatrix() on your mesh (after you change the scaling), in case it would not be computed automatically…

1 Like

Make sure you didn’t call freezeWorldMatrix on the mesh

Or call unfreezeWorldMatrix first

1 Like

Thanks for the help folks, I tried both of these with no luck so may need to put a playground together

What’s the issue? Babylon.js Playground
This works

Not to be preachy, but scaling of a single mesh at run time can cause all kinds of problems. These are usually based on the fact different meshes have their own origin, & location. If you can take the time to bake all the scales of meshes which are not (1, 1, 1) prior to export, I would do that.

For work which might at some point will go into a WebXR scene / device, I would standardize all meshes to look correct when viewed in a meter scaled scene. Reason being, as the person walks through the scene, the camera will be advanced by the headset hardware in terms of meters.

Hey @ryannewelluk…would love to help.

I just tried scaling an asset in one of my own local projects and it worked just fine…same as @Givo.

Let us know if there’s anything else we can do to help