Why is that? Because of physics? Any idea?
Seems to be like it is the default behavior of the drag, TTry dragging this one here - https://www.babylonjs-playground.com/#DEYAQ5#47 reacts almost the same. I doubt it has anything to do with physics, as physics is not enabled in the scene (unless I missed something)?
Your example works fine. Mine is rotating when just draging it. Must have some wrong code there. It’s always turning towards the zero point. (when I drag it over the zero point, it gets crazy)
You should not update the mesh’s position (as you are doing in the drag event) the drag behavior is taking care of this for you
I’ve edited your PG - changed the camera and the shape of the box. Now it has the same weird behaviour as in my first example. I can’t understand why that rotation occurs…
Seems to me like the default behavior still - https://www.babylonjs-playground.com/#DEYAQ5#80 (this is the default playground with the camera looking from above).
Seems to me like the camera angle is being taken into account. notice this - https://www.babylonjs-playground.com/#DEYAQ5#81 , the behavior is different. try changing the camera’s position and see if it helps. (BTW - I am not saying this is not a bug, i am just saying it is nothing in your scene).
@Deltakosh , what do you think?
This looks weird. I’m gonna take a look.
By default, SixDofDragBehavior rotate object when moved around. Add
sixDofDragBehavior.rotateDraggedObject = false;
to disable it. Like I did in this PG https://www.babylonjs-playground.com/#DEYAQ5#82