Behaviour of DragControls in AR scenarios - horizontal movement

I think chrome on android was caching too hard. I commented everything out except a console.log for all of the onPointerEnter etc events and they weren’t firing on mobile but after a re-export it finally updated on the phone

by user 103054507105067008

Trying to find where it swaps between the desktop version of the dragging and the XR version of dragging so I can stop that but I think I sorted that

by user 103054507105067008

Okay, so I went in and added the pointer events used, but commented out any logic to do with dragging except the addDragEventListener which seems to overwrite anything if we are in XR it still makes the object movable with the camera when it shouldn’t move
ARMoveScaleRotate.ts

by user 103054507105067008

Just confused me because I thought I commented out all the onDrag logic

by user 103054507105067008

Does it get swapped out into a different component when we enter XR? Even though it is a component I have made myself

by user 103054507105067008

No it doesnt

The drag controls component is still in the scene?

Or do you replace it with your own?

All of the pointer events fire a console.log only but somehow dragging still works
unknown.png

by user 103054507105067008

ah you might need to set canGrab to false if you use the Interactable (you derive from it)

It’s my own component, the one I sent the script of above, no DragControls in the scene at all

by user 103054507105067008

Trying now, was confused because I took out any logic for dragging and just wanted to get the pointer events but the object was still draggable in AR while firing my console.logs

by user 103054507105067008

As said - in AR the touches act like controllers by default.

Am I going the wrong route to doing AR pointer events I assume :sweat_smile:

by user 103054507105067008

Ok so canGrab being false sorted that

by user 103054507105067008

That’s perfect actually as I can use canGrab to switch out into your controller based grabbing if needed

by user 103054507105067008

I never heard back from @Adoran on this but today I am starting with an experiment of integrating Google’s Model Viewer into Needle for draggable AR placement https://modelviewer.dev/examples/augmentedreality/#webXR

by user 103054507105067008

I guess you mean integrating their camera controls specifically?
Would be these:

Yep, specifically the placement of the objects in AR with drag/scale/rotate pulling in through touches for simple AR product viewing

by user 103054507105067008

Thanks, going to start there

by user 103054507105067008