Disentangling rotation and teleportation in VR


hi there, I want to disable teleportation, but preserve rotation; I don’t think there’s currently an option for that yet

how does one “go into” the source code of babylonjs in order to find the rotation code and “pull it out”?

that’s the best way to achieve my objective, right?

again, thank you

1 Like

@RaananW your the most famous of the day :slight_smile:


Yeah, you are totally right! There is a way to disable the rotation, but no way to disable the teleportation. Want to submit an issue?

And yes, this is the current best way to do that…

How do I submit an issue? Like, where is webpage on github where I’m supposed to do that? (sorry, I’m like a pro hacker, but not a pro dev).

Same issue above, do you have a link to the github page where all the webxr stuff inside babylonjs is happening? Very excited to dig around in there.

Go to the repo’s issues on github and create a new one. The instructions are there, you can link this forum post when it asks you to :blush:

I believe I did this semi-correctly: disentangling rotation and teleportation in VR · Issue #10202 · BabylonJS/Babylon.js · GitHub

1 Like

is this where ‘all’ the xr code is? Babylon.js/src/XR at 6c22914668aaa747fb179114c153ac5b0efede50 · BabylonJS/Babylon.js · GitHub

A big chunck of it yes.

1 Like

would y’all be able to point me to where “rotation” is (when you enable teleportation), so I can try to rip it out and make it independent of teleportation?

there is now a way to turn teleportation off, leaving you with rotation only. A new flag was introduced not so long ago, thanks to this thread :slight_smile:

1 Like

That is awesome!

Now, question, “a new flag was introduced”-- I’m not sure what this means re: how to program it?

Is it documented somewhere? ← n00b question

Setting teleportationEnabled to false will get you what you asked for :sunglasses:

1 Like

woops, sorry, I still can’t figure out how to use this–

I’m not sure what “teleportationEnabled” belongs to? the controller, the xr helper?

in this code [XR] allow disabling teleportation by RaananW · Pull Request #10208 · BabylonJS/Babylon.js · GitHub it kind of looks like the controller?

this is probably a beginner thing, but I’m just not sure how to deploy it

All good :slight_smile:

This is a flag on the teleportation feature, that is a part of the default xr experience. if you init the default xr experience, it is in xr.teleportation. setting xr.teleportation.teleportationEnabled = false will prevent users from using the thumbstick to teleport, but will allow them to rotate, since rotation is enabled