Can't rotate a Mesh

Hi, I want to rotate a mesh but not with addRotation, juste with rotation.y like this :
https://www.babylonjs-playground.com/#1ST43U#47

but it doesn’t work with my mesh :confused:
https://playground.babylonjs.com/#VRFDF0
edit : with check if mesh is not null: https://playground.babylonjs.com/#VRFDF0#1

Thanks for your answers

Check your console (F12)… your mesh is null at this moment …
Wait for it to be downloaded : https://playground.babylonjs.com/#VRFDF0#1

Maybe it’s not the right object that you want to rotate though

Thanks for your answer.

I’ve checked and it’s the right object, An idea why i can’t rotate it ?

Thanks

The mesh has a rotationQuaternion set, which takes precedence over the rotation property, so you could put it into the rotation property, and set it to null:

https://playground.babylonjs.com/#VRFDF0#2

You can also rotate the mesh while keeping the quaternion:

https://playground.babylonjs.com/#VRFDF0#4

4 Likes

A huge Thanks Gijs !!
A can now tween the value
You made my day :heart:

1 Like