Align Level to Oculus Quest Guardian Area?

Does anybody know if there is a way to align a level to to the Oculus Quest guardian?
Right now my setup needs manual calibration while standing at a fix starting point, looking at a certain direction in my play area.

So every time the app starts it is necessary to re-calibrate the player postion and viewing direction.

As far as I can tell, the oculus quest in theory provides everything for this and and there also a couple of functions for the guardian, they don’t work as expected.
The “play area transform” and “guardian points” only return the transform data relative to the player start, not the actual Oculus guardians…
totally wrong.

Seems to me like a pretty important feature for a lot of games but its not very well documented and there are no tutorials out there…
https://docs.unrealengine.com/en-US/…ian/index.html

Would be great if someone could give some advice…

Cheers
Felix

thats what i am basically trying to align… the oculus guardian matches perfectly with the tape on the floor, but the in-game position needs to be calibrated manually…

the black debug text is the transform data from the “get play area transform” but this just returns the position of the player start…

Nobody? :rolleyes:

Ok I found some samples provided by Oculus/Unreal which helped a lot, so if anybody is else looking for help regarding this topic, check these files: https://developer.oculus.com/documen…ples/#boundary

BUT

There is still one issue I am trying to understand:

I am using the function “Set Tracking Origin / Stage (Centered Around Play Area)” and I’ve drawn the boundaries along a taped-rectangle on the floor (2.0m x 2.5m)
Not matter what I try, sometimes the the unreal level matches exactly my play area and sometimes its rotated by 90° degrees.

Is there anything special I need to consider when setting up a boundaries? My first guess was that the first stroke of the boundary would define the x-axis of the stage, but it seems like this doesn’t have any affect. Same with clockwise/counter clockwise or the edge length of the play area… still random and sometimes it matches, sometimes it doesn’t…

If anyone as an idea why this keeps changing almost randomly, please let me know. :slight_smile:

1 Like

Hi Fele,
Did you find a solution for this?
I’m stuck at the same point.
Any help will be appreciate!
Regards,

Which version of Unreal are you on?

I’ve tested this extensively in 4.27 with OpenXR and I haven’t seen the randomness of playspace rotation that you’re experiencing. Take a look at the VR Template in 4.27 for a setup that aligns the virtual floor with Guardian’s floor.

Can anyone help me?
I am using Oculus cuest 2 and when I want to get the location of points from the Get Guardian Points tag (as shown in this link https://developer.oculus.com/documentation/unreal/unreal-sample-boundary/) I have all the values at 0 all the time! What am I doing wrong? how to get the coordinates of my grid?

This topic seems to be helpful for what I am trying to do. I have been building a VR haunted house in my garage with the quest 2. How do I align my level to the center and orientation of my guardian? Could you please show the full blueprint setup. I posted so far what I have been able to come up with.

Hi Ulring,

I think the simplest thing to do would be to model the shape/size of your garage → Choose a location and direction at one specific point in your garage → Set your Player Start at this location.

Then, while standing at that location and facing the intended direction, press and hold the Oculus button on your right controller to recenter.

Thank you but I have already been doing the manual route of standing in the middle of my garage and recentering. I need an automatic solution. I want to walk into my garage and see my level aligned and rotated properly without manually doing it. I see in Unreal nodes for “Get Play Area Transform”, “Get Guardian Dimensions”, and “Get Guardian Points”. Seems to me I should be able to snap the center of my level to the middle of my guardian automatically. Any ideas of how to implement these nodes?

I am also very interested in this topic!! I have tried soooo much stuff … and such basic and simple thing (to adapt your map to the current guardian area dimensions, distributing the meshes or whatever accordingly) seems so complex and unnkown.

Understanding “Get play area transform” - Development / Programming & Scripting - Epic Developer Community Forums (unrealengine.com)

Please, somebody smarter help us :slight_smile:

I got it!! It took me months… OMG

I simply used the Get play area transform and connect it to a blueprint Actor´s transform’s sockets. Inside this blueprint actor you can spawn other actors, and they will stay relative to the size and position that the Get play area transform sets for the first blueprint actor.

I guess there are other ways to use this feature, but it’s the only one I could figure out. Really bad that nobody outthere or no documentation could help to figure out easily

Now my level adapts relative to the size of the play area, and it stays always the same!
Also it doesn’t change when Quest looses track or you get out of the play area (before it would just change the whole level’s position).

:smiley:

Very nice. Could you show how to set it up by posting some screenshots? Not sure if I follow. Did you set it up in your level blueprint and then cast to an actor?

I used “Get Play Area Transform”, split the pin and connected the Location and Rotation to “SetWorldTransform”. To test I connected the the Target to a cube mesh. A cube successfully appears in the center of the play area and doesn’t move when taking off the headset. So I know that works. How do I grab the center of the level? I have a persistent level that streams two levels and switches between them at a trigger box. Both levels are fully detailed Box Brush for walls, props, characters, sounds, and decals. I cant simply grab everything in the World Outliner and attach it to an actor or mesh. There has got to be a way to grab the center of the level or world. Any ideas?

Hey! Sorry I have a lot of work next weeks and cannot get into details, but basically you can connect the transform from the “Get play area …” to the transform of a blueprint that contains inside a space and some objects (to use them later as locations for stuff you want to Spawn in a relative position on the space).

Inside that same blueprint, you spawn a character (or whatever) using as location one of those objects, and it will appear in that place (and that place has been already “deformed” relative to your play area)

It’s really messy process I know, but somehow it works.

It’s really sad there’s actually not tutorials or documentation about this.

I just cannot understand… it’s quite an important thing to align stuff to the play area… How isn’t an easy and clear procedure for this???

Best of luck

By the way, you also have to connect the “size” , so it resizes your blueprint to the play area

Also you have to connect the Even Tick to the World Transform, not the Event Beginplay

No problem. I was gone for a bit myself. I found a solution through “Load Level Instance (by Name)”. You plug the “Get Play Area Transform” by splitting the pin and plugging Location and Rotation. Scale will show miss aligned results because of sizing. I have it set up with “Event BeginPlay” because if I use “Event Tick” I am pretty sure I will load the level continuously. Use a Persistent Level to load your level.

Problem you may run into is Level Sequences not being in the proper place. I also had to attach the sequences and content within to a parent such as a static mesh.