Hello, I am facing a bug apparently caused by a lack of orientation of an object that get worse when I try to apply rotation. How do you fix that ?
Playground :
Goal :
place an object in AR based on the camera position and orientation. When it is placed, the object is attached to a WebXR Anchor.
Issue :
when the object is attached to the anchor, it gets flipped randomly.
Intended behavior :
The behavior in the playground in 3D not immersive is the intended behavior.
Attempts at fixing :
I noticed that the rotation of the plane was never set. So I first tried to fix a rotation when adding to the camera, but the object is then not always facing the camera anymore when moving it around. Not ideal. I then tried to rotate it after dropping, but then it disappears…
How to reproduce :
- Open the playground anywhere
- click on spawn
- move the camera around
- click on place
- move the camera around
- Open the playground in a WebXR environment with anchors
- reproduce 2 to 4
Author note :
I am fairly new to babylonjs, so this might be super trivial, yet I could not find a mention of this neither on doc nor in the forum. Can you please help me ?