Obtain Guardian Boundaries on Quest


Some people wanted to Disable Guardian on the Oculus Quest (thanks to Mike for sharing the helpful instruction). A lot of them might have the requirement for obtaining the guardian boundary in their apps. In this blog, I am going to share the method to obtain and visualize the guardian boundaries in your Unity app.

If you would like to get boundary contours in Unity, you can call OVRManager.boundary.GetGeometry(OVRBoundary.BoundaryType.OuterBoundary) after you import Oculus plugins. The function gives you an array of Vector3 points that define the boundary created when you do the room-scale setup. It will return the center point if you choose the stationary setup.

There are two types of boundaries: PlayArea and OuterBoundary. OuterBoundary consists of up to 256 points which closely match the boundary in clockwise order at the floor level. PlayArea returns the maximum rectangle we can get within the boundary, and you just need to change the BoundaryType into OVRBoundary.BoundaryType.OuterBoundary

Leave a Comment

Your email address will not be published. Required fields are marked *