Any way to change the object being teleported?


I have a really weird requirement - basically, I am using a VR gallery component that does not work with the XR Origin camera, so I solved that problem by combining the hand controllers of XR Origin with the cameras of OVR Player Controller (from the Oculus SDK). This has worked perfectly and I created a number of scenes that did not require movement - however, now I have come on to looking at adding teleportation for a menu scene - this is causing me a problem as the “player” game object is essentially separate from the XR Origin object. When I click on a part of the Teleportation area this transports my hands to that position but not my camera. I have tried nesting the OVR Player Controller under the XR Origin object and setting the XR Origin object camera to be my player camera - to no avail.

Is there a way I can change the object that is being teleported on pressing the grip button? I have struggled to find where in the scripts for any of the interaction managers or teleport areas this function occurs. I am also open to suggestions of other ways I could create my hybrid monstrosity - or other potential advice.

I am wondering about also just matching my player object position to that of the hands on teleporting as a workaround.

Teleportation isn’t difficult. You will need your own script but basically line trace from your controller and find the point where you need to teleport to, x and z only unless you are changing elevation in which case you’ll need the offset for the y axis as well. Apply these to what you wish to move on releasing whichever button you wish to use.

The actual script is probably 10 lines of code, binding to the controller button will be more tricky to be honest.

Privacy & Terms