Reset VR player to a certain position in the level

Hi!

I’m struggling to reset the position of the player to a certain position in the level.
I’ve setup the key bindings for the Oculus touch controler and would like to do the following:

On button press set the location of the player to a specific location in the level.

Thank you for your help!

Hi MErbrich,

Easy, It’s good practice to operate on the top-most component (in this case Default Scene Root). Also this can be called from anywhere since it takes the active pawn (VRPawn is what the pawn is named in the VR Template, your pawn may have a different name)

Also, if you want to set the rotation too you could use ‘SetWorldTransform’ instead of just location.

Let us know if you have any more question.

2 Likes

Hi!

Thank you! This works for me sometimes. I think the problem doesn’t occur because of the blueprint itself.
I would like to rebuild my home and walk around it in VR. But the Quest doesn’t let me move all over the place. Seems like the position of the pawn is somehow affected by the guardian system and position within that.

Are there any solution for this?

Thank you :slight_smile:

Good morning!

I did some more research and there seems to really be a problem with the Quest.
I’ve turned off the guardian system using Sidequest. Now I can walk around freely.

The problem with resetting the player position can now be fixed by resetting it using the built in reset of the Quest. Unfortunately it only works when using Air Link and testing the app in the engine, not with a deployed version on the headset.

Does that make sense? Is there a fix?

Thank you! Already got a headache from taking on and off the headset…

Good morning,

Glad to hear you made progress. Your problem does make sense, but it’s strange that it’s only working with Air Link…

Have you tried using the ‘Reset Orientation and Position’ from Blueprints? It should do the same thing as the ‘built in reset’ but you may see a different result.

The idea then would be to pick a spot+direction in your house/room that you’d stand in when resetting, then after reset virtual geometry should line up with real-world geometry.

Cheers

Good morning :slight_smile:

I’m trying to achive this at the moment. I don’t really know how to achieve it. I need to find a reference point and track the current position relative to that point I think. It’s getting pretty complicated.

How would you achieve the reset? It would be great to not have to start the app at that exact position in real space but to set the start point to it.

UPDATE: I went further down the rabbit hole… I’ve linked a cube to the VR Camera component in my VR-Pawn via blueprint. Seems like the positions is being reset for 1 frame but then jumps back to the previous position. I’ve uplodaded my current setup.

Thank you :slight_smile:

Hi again,

So the reset is something you don’t want to do more than once. (So resetting on Input Axis events like you have set up is very weird)

Imagine something like “Spacebar(Or just 1 button on the VR controller) → Reset”

You wont need to start the app in the exact position, you would start the app wherever, then walk to the position and reset.

At that point the only way you’d want to be controlling your location is by moving in physical space. (any sort of artificial locomotion will desynchronize your location within your virtual house)

Hi :slight_smile:

That’s exactly what I like to do. But it just doesn’t work. I’ve hardcoded the position in the level that matches exactly the position in my room. Somehow there remains this offset I can’t change.
I really don’t know what I can do anymore. The blueprint shows I’m totally lost.

One important aspect of all this is for the position that you choose in your real-world room should be position 0,0,0 in your virtual room. Give that a try, you can press CTRL+A in Unreal Engine to select everything in your level to move it into correct position/rotation.

Cheers

Why trying to walk to Rome when Rome can come to me :smiley:

So this approach works pretty well! It’s just important to start the app on the start position. So it’s a bit annoying during development. Other than that, perfect!

Thank you!

1 Like