Best method to interact with meshes in VR Quest 2/3 - Grab, drop, etc

Hi, I’ve found this example to grab some objects in VR:

Is this the best practice?
How can I add grab functionality to my imported mesh with this method?

PS: I’ve found that there is another example using SixDofDragBehavior to grab meshes in scene but I cannot do it work with the squeeze button of the controller…

Thanks in advance

@RaananW will be able to tell you if that playground is still the best practice for grabbing objects in XR.

For the SixDofDragBehavior issue, please make a playground showing the issue and post it here.



yes, it is a good way to grab objects that are colliding with your controller. It is the simplest - set the hand/controller as a parent, and then null the parent when you let go. This won’t animate the object moving towards you. 6DoF works with pointer events, which require the main trigger to work.
The playground you pasted is a nice example of how to get the squeeze button’s state. Using this you can do whatever fits your use-case. For example, if you point at an element and squeeze, you can animate the object towards the controller.