Drei - DragControls

Hi, I’m wondering if someone could post an example of controlling some object position using Drei DragControls component, that is placed outside of DragControls component.

<>
  <DragControls><Anchor /></DragControls>
  <MyComponentIWantToMove />
</>

Like stated here: “(…) Alternatively, keeping autoTransform enabled allows you to apply the matrix to external objects, enabling DragControls to manage objects that are not directly parented within it.” I’m trying to applyMatrix4 with matrix that is returned by onDrag handler, but I’m doing it wrong, because my controlled element gets blasted off the screen immediately I move controls

Cheers

Like stated here: “(…)

can you link to these docs? do you have a codesandbox or codepen or something of your app showing this issue?

if possible, try pivotcontrols for this. DC is not very flexible.

moving objects: https://codesandbox.io/p/sandbox/practical-buck-xtwvxm

moving outside objects with a matrix: https://codesandbox.io/p/sandbox/multiple-views-with-uniform-controls-r9w2ob