cancel
Showing results for 
Search instead for 
Did you mean: 

Teleportation system for Quest in Unity

TalsiSunstorm
Honored Guest
Hi,
I have issues with teleportation system in Unity and I was hopping to get some help around here. Now, I have basic understanding about game development but I am very much new to this.
By following tutorial on youtube ("How to Teleport in VR" by Valem - can't post links apparently 😕 ) i have tried to make teleportation system, but no matter what I do, it does not work. I read several articles and Oculus documentation (including Locomotion Sample Scene - and even if I set it precisely as in this document it still does not work) and according to all I read it should work. But instead of teleporting me to designated spot, it kind of pushes me around. There seams to be some weird correlation between where I point and where end up - I would say its mirrored but its hard to say.
I am using Unity version  2018.4.12f1 with latest version of Oculus Integration (1.42). I just need very basic (push button -> aim -> release to teleport) functional teleportation system to learn on. :'(
Could anyone help?
6 REPLIES 6

Timo3000
Explorer
The teleportation system was broken from the beginning on. I just tested it with 1.42 and yes, still broken. There are some ideas to fix it (e.g. set correct fixed time) but nothing works for me. It's a real pain, because this is such an integral point in making a game and they just don't fix it 😞

jjennings1990
Honored Guest
I'm also  having  a really hard time getting teleportation working , I actually followed a tutorial for how to get teleportation working for  the rift and it doesn't workin the Quest  the first time it does a teleport push but it's like the lasers aren't following my player and OVR controller , then I tried using the locomotion sample scene and like you said OP it almost seems inverted  as it send me somewhere opposite where I point when the locomotion options even activate.

TalsiSunstorm
Honored Guest

Timo3000 said:

The teleportation system was broken from the beginning on. I just tested it with 1.42 and yes, still broken. There are some ideas to fix it (e.g. set correct fixed time) but nothing works for me. It's a real pain, because this is such an integral point in making a game and they just don't fix it 😞


That's not very encouraging, thank for the reply thou 😉 
Does anyone have working tutorial (or prefab) for teleportation that I could use?

TalsiSunstorm
Honored Guest
Finally found solution!
Anyone who is having similar issues, you can follow new tutorial at learn unity its called "Design, Develop, and Deploy for VR". For most parts it uses assets from VRTK instead of Oculus Integration (maybe that's why it works :smile: ).

Timo3000
Explorer
I REALY found a solution: Update to SDK Version 12. Locomotion is now FINALLY working 😉

Grirvaldr
Honored Guest
I am reviving this as I found the true answer:

Go to LocomotionTeleport.cs and paste this in the class:

public OVRPlayerController oVRPlayerController;

Then, go to the DoTeleport method and paste over it with this:

public void DoTeleport()
{
var character = LocomotionController.CharacterController;
oVRPlayerController.enabled = false;
var characterTransform = character.transform;
var destTransform = _teleportDestination.OrientationIndicator;

Vector3 destPosition = destTransform.position;
destPosition.y += character.height * 0.5f;
Quaternion destRotation = _teleportDestination.LandingRotation;// destTransform.rotation;
#if false
Quaternion destRotation = destTransform.rotation;

//Debug.Log("Rots: " + destRotation + " " + destTransform.rotation * Quaternion.Euler(0, -LocomotionController.CameraRig.trackingSpace.localEulerAngles.y, 0));

destRotation = destRotation * Quaternion.Euler(0, -LocomotionController.CameraRig.trackingSpace.localEulerAngles.y, 0);
#endif
if (Teleported != null)
{
Teleported(characterTransform, destPosition, destRotation);
}

characterTransform.position = destPosition;
characterTransform.rotation = destRotation;
oVRPlayerController.enabled = true;
}

All I am doing here is enabling and disabling the OVRPlayerController before and after the teleport. I assume this is because of some clowny under the hood reason that I care not to try and figure out. Best of luck to you all