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
https://playground.babylonjs.com/#VRFDF0
edit : with check if mesh is not null: https://playground.babylonjs.com/#VRFDF0#1
Thanks for your answers
jerome
November 28, 2019, 11:24am
2
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
Gijs
November 28, 2019, 12:24pm
4
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
1 Like