Strange sixd drag behavior on a model

Hi all,
The sixd drag is not working correctly if the “root” mesh is given a parent I don’t know how to solve it.

This simple PG works - drag test | Babylon.js Playground (babylonjs.com) . It attaches a behavior to the parentNode you have created

In your example, it seems like you are attaching to the wrong parent. I didn’t follow the code fully, but if you do this - drag test | Babylon.js Playground (babylonjs.com) it does work (i.e. attach to the last parent of the tree).

2 Likes

Thank you it works much better, could you please help me with the issue of dragging child meshes when the button is pressed?
Do i need to find the first parent of the child mesh and try to drag the whole transform node instead of the single child mesh?

I am not entirely sure what you are trying to achieve, so it is had to answer. Are you trying to be able to drag specific parts of a mesh? Or move the entire mesh? Or both? :slight_smile:

I would like to be able to drag specific parts of a mesh, the idea is when i tap on a part of a mesh, let’s say a wheel, that wheel is now dragable, and if i tap on multiple meshes in a row, they all become draggable. Thank you for all your help.

I believe you should maintain the state of the pointer event(s) a little better, but this would work - drag test | Babylon.js Playground (babylonjs.com)
remove the parent from the single mesh when dragging it, and then set it back when you are done with dragging

1 Like

Thank you very much

1 Like