In the AR game I’m developing I have several XRToolsPickables . Some of these I’d like to be able to move in all directions, but only allow to rotate around the Y axis. I specifically don’t want them to rotate around the X and Z axis (along the lines of the game platform in Angry Birds VR) . I’ve been mostly successful by overriding _physics_process on my pickable subclasses
What I see though is the grab point is visually off from where the user grabbed the object
I’ll start investigating the use of actual XRToolGrabPoint objects (and perhaps intractable and handles as well) but I’m curious if others know a better / easier way of accomplishing what I’m trying to accomplish
Update: I tried setting XRToolsGrabPoints but unfortunately they don’t seem to work well in combination with the degrees of freedom limiting code I added to my pickable node.
As the pickupables system invariably links the positioning and rotation of the held object to that of the hand, there is indeed no support here for further contraints (other than the two handed implementation).
Have a look at the interactables demo in the main XR tools demo that shows off the interactable types. These are positional and/or rotationally locked objects that can be manipulated with hands. Here the hands location is fixed to the object and the object drives the positioning.
After digging into how the transform for the held object was calculated I had one other thought that seems to be working out well - instead of adjusting the transform of the picked up object, I constrained the allowed rotations of the picker by extending FunctionPickup
Indeed, all sorts of logic where you want to snap the thing you’re holding to where it will end up when let go, would benefit from rethinking our strategy here.
Right now we drive everything through the hands, and we jump through hoops when the held object is constraint in some way, whether because it interacts with other physics objects, whether we’re doing two handed pickups, or in a situation as yours where you want to limit movement.
I hope to find more time to experiment with it but I’m starting to think along lines that once you pick an object up, positioning is no longer driven by hand positions, but the tracked location of the hand or hands drive the movement of the object, and the hands are simply drawn where they end up even if detached from their actual tracking location.