How to rotate Mesh on the AR

With the sample below, How to rotate the Robot after attachedNode?

The anchor you attach your mesh to is the parent of your mesh. You can rotate the mesh just like you rotate any other mesh - you have the .rotate function, you have the lookAt function, you can use the model’s rotation quaternion too. You should rotate it in its local space. It will still be connected to the anchor (and the anchor’s transformation), but will have its local transformation applied on top of it.

Please view my source in the sample and update your code.
Expected results: When clicking the “Left” button the Robot will rotate and keep status after rotating.
Currently, with my code, the Robot rotated but it does not keep status after rotating

ti achieve that you will need to add a transform node between the mesh and the anchor:

Babylon.js Playground (


Thank you so much!
With your sample, please help me update the Robot position correct with the anchor position after showing the Robot on AR