Search Unity

Question Concerning the Chaperone using an occulus device

Discussion in 'VR' started by Ugi_Keta, Mar 16, 2021.

  1. Ugi_Keta

    Ugi_Keta

    Joined:
    Feb 17, 2021
    Posts:
    3
    Hi everyone,

    It's my first thread on the forum, I would like to have some help concerning the chaperone when using my VR headgear, is there a way to modify/ manipulate it via a C# script ? I would like to manipulate it when my application is ongoing.

    Thank you in advance for your help,

    Best regards,
     
  2. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    105
    Hi,
    I don't think there is a way to manipulate guardians/chaperone via script for Oculus devices, since guardian boundary is also a safety feature that help you stay within your cleared play area.
    But I am curious the use cases that need to manipulate it via script if you could share?

    Thanks,
    Tanya
     
    Ugi_Keta likes this.
  3. Ugi_Keta

    Ugi_Keta

    Joined:
    Feb 17, 2021
    Posts:
    3

    Hi Tanya,

    Thank you for your answer, I forgot to reply ^^', as you said, there is no way to access by script the chaperone, but I somehow resolved my problem by accessing the Play Area via SteamVR.

    "But I am curious the use cases that need to manipulate it via script if you could share?"

    - I wanted to maybe create an animation by using the chaperone, or at least be able to disable it whenever I want to. For example, when I push a button or something like this.

    Thank you for you help,
    Guillaume
     
  4. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    105
    You could check out OculusBoundary.cs within Oculus XR plugin. (install XR Plug-in Management --> choose Oculus checkbox under Plug-in Providers)
    There are public APIs like below:

    Code (CSharp):
    1. /// <summary>
    2. /// Requests that the boundary system visibility be set to the specified value.
    3. /// The actual visibility can be overridden by the system (i.e., proximity trigger) or by the user (boundary system disabled)
    4. /// </summary>
    5. public static void SetBoundaryVisible(bool boundaryVisible)
    6.  
    7. /// <summary>
    8. /// Get a vector of the spatial dimensions of the specified boundary type. (x = width, y = height, z = depth) with height always returning 0.
    9. /// Return true if boundary dimensions are supported and values are available. Return false otherwise.
    10. /// </summary>
    11. public static bool GetBoundaryDimensions(BoundaryType boundaryType, out Vector3 dimensions)
    Besides, XRInputSubsystem also provided an API to obtain guardian geometry/points:
    https://docs.unity3d.com/ScriptReference/XR.XRInputSubsystem.TryGetBoundaryPoints.html
     
  5. Ugi_Keta

    Ugi_Keta

    Joined:
    Feb 17, 2021
    Posts:
    3
    Thank you, I'll check this out, I've just started working recently on VR so there is a lot to process.