API reference
API reference
Select your platform
No SDKs available
No versions available

OVRSpaceUser Struct

Extends IDisposable
Represents a user for purposes of sharing scene anchors.
In order to share an anchor, you need to specify the user or users with whom you'd like to share those anchor(s).
An OVRSpaceUser is a lightweight struct that wraps a native handle to a space user. You can create an OVRSpaceUser from the user id of an Oculus user obtained from the Platform SDK.

Properties

Checks if this is a valid handle to an authenticated space user.
The OVRSpaceUser may be invalid if it has been disposed (Dispose) or if creation fails. For example:
void Test(ulong platformUserId) {
if (OVRspaceUser.TryCreate(platformUserId, out var spaceUser)) {
    Debug.Log(spaceUser.Valid); // True
    spaceUser.Dispose();
    Debug.Log(spaceUser.Valid); // False; spaceUser disposed
  } else {
    Debug.Log(spaceUser.Valid); // False; creation failed
  }
}
The org-unique Oculus user ID associated with this OVRSpaceUser.
This property is the spaceUserId argument provided to the OVRSpaceUser constructor, or zero if the OVRSpaceUser is not valid (Valid is false).

Static Member Functions

Tries to create a handle to a specific Oculus user in the current conceptual space.
platformUserId should not represent the numerical value 0. This is a common value to inadvertently obtain, usually in cases involving insufficient app, user, or device permissions.
Parameters
platformUserId
A user's unique ID provided by a support platform, i.e. the org-unique Oculus user ID. You must request these IDs e.g. from the Platform SDK.
See also: Oculus.Platform.Users module.
spaceUser
The result of the space user creation request; will only be Valid iff this method returned true.
Returns
true iff spaceUser is a Valid handle to a user in the current space.
Tries to create a handle to a specific Oculus user in the current conceptual space.
platformUserId should not represent the numerical value 0. This is a common value to inadvertently obtain, usually in cases involving insufficient app, user, or device permissions.
Parameters
platformUserId
A user's unique ID provided by a support platform, i.e. the org-unique Oculus user ID. You must request these IDs e.g. from the Platform SDK.
See also: Oculus.Platform.Users module.
spaceUser
The result of the space user creation request; will only be Valid iff this method returned true.
Returns
true if spaceUser is a valid handle to a user in the current space.
false may be returned if platformUserId is null or could not be parsed as a numerical ID.

Member Functions

Creates a handle for a specific platform user in the current conceptual space.
This constructor does not perform any kind of validation. You should consider checking the Valid property after construction, or use the TryCreate(ulong,out OVRSpaceUser) static method instead.
Parameters
spaceUserId
A user's unique ID provided by a support platform, i.e. the org-unique Oculus user ID. You must request these IDs e.g. from the Platform SDK.
See also: Oculus.Platform.Users module.
Disposes of the OVRSpaceUser.
This method does not destroy the user account. It disposes the handle used to reference it.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon