Hello,
I am currently trying to get the rotation of a mesh but I get the error such as Cannot read property 'rotation' of null
. I do the same for a transform node - getTransformNodeByName and that works without any issues. But when I try to achieve the same with a mesh, it causes this problem. What is the solution here?
var currentRotation = { x: 0, y: 0 };
let mesh01 = scene.getMeshByName("Mesh001");
currentRotation.x = mesh01.rotation.x;
currentRotation.y = mesh01.rotation.y;