Reset child mesh rotation

I have a sphere physics impostor and a regular cube mesh as a child.
The sphere rotates on the z axis.

How do i reset the child mesh z rotation to zero?

Wanna share a playground so we can help with code?

Will help us a lot to understand exactly what you are trying to achieve.

1 Like

I want to reset the cube z rotation to zero in the render loop.
The cube should not rotate, only the sphere.

You can try to apply the sphere inverse transformation to the cube:

scene.onBeforeRenderObservable.add(() => {
    cube.rotationQuaternion = BABYLON.Quaternion.Inverse(sphere.rotationQuaternion);

[EDIT]Added a texture to the sphere, else we don’t see it is rotating[/EDIT]


Thank you!

It works as i wanted :slightly_smiling_face:

1 Like