Rufus31415 / Simple-WebXR-Unity

⭐ Bringing WebXR to Unity 3D ! B-)
https://rufus31415.github.io/webxr/MRTK-HandInteraction/
MIT License
569 stars 80 forks source link

How to enable teleportation? #47

Open medinags opened 2 years ago

medinags commented 2 years ago

Hello, Thank you for this very useful package. I am new to WebGL, but I have some experience with MRTK. I am trying to use teleportation in the Oculus browser. But I can't get it to work. In MixedRealityToolkit it is active.

image

Do I have to do something else to activate it? Merci!

Rufus31415 commented 2 years ago

SimpleWebXR inputs support teleportation.

https://github.com/Rufus31415/Simple-WebXR-Unity/blob/f00c57aa2241d464e6d151afcf3347266beb03fc/SimpleWebXR-Demo/Assets/SimpleWebXR/Scripts/MRTK/SimpleWebXRController.cs#L29

https://github.com/Rufus31415/Simple-WebXR-Unity/blob/7b37e75ede96f70f4f16bb968c1b487c889ba782/SimpleWebXR-Demo/Assets/SimpleWebXR/Scripts/MRTK/SimpleWebXRHand.cs#L43

But it seems to me that you have to select a teleportation compatible pointer

medinags commented 2 years ago

Hello, Thank you for replying In inputs I have the SimpleWebXR profile image And I have this as a Pointer image Do I have to select another one?

Rufus31415 commented 2 years ago

OK, everything seems ok, if you find what's going on, can you tell me ?

medinags commented 2 years ago

I'm testing the scene MRTK-HandInteraction

There is a script called "OculusQuestThumstickHandler.cs". That is supposed to execute the teleportation, but what it does is to move the player.

https://github.com/Rufus31415/Simple-WebXR-Unity/blob/7b37e75ede96f70f4f16bb968c1b487c889ba782/SimpleWebXR-Demo/Assets/SimpleWebXR/Examples/Scripts/MRTK-HandInteraction/OculusQuestThumstickHandler.cs#L28

Another thing, did you test the teleportation in this scene, or should it be added from a new script?

Rufus31415 commented 2 years ago

Yes this is just a workaround to move the player. But it doesn't use MRTK teleport feature.

Yes I tested teleportation, but I don't think there are any examples online that show this