Skip to main content

StageTimePlayer

class StageTime.SDK.StageTimePlayer

A player in the room (like VRCPlayerApi).

Fields​

playerId​

readonly int playerId

The player's id in this room (stable while they are in it).

Properties​

displayName​

string displayName

The player's display name.

isLocal​

bool isLocal

True for the player on this device.

isMaster​

bool isMaster

True for the room's master.

Methods​

IsValid​

bool IsValid()

True while the player is in the room.

IsUserInVR​

bool IsUserInVR()

True if the player is in VR (false on desktop and mobile).

GetPosition​

Vector3 GetPosition()

The player's position (feet).

GetRotation​

Quaternion GetRotation()

The player's facing rotation.

GetHeadPosition​

Vector3 GetHeadPosition()

The player's head position.

GetHeadRotation​

Quaternion GetHeadRotation()

The player's head rotation.

TeleportTo​

void TeleportTo(Vector3 position, Quaternion rotation)

Moves the player. Works on the local player only.

IsOwner​

bool IsOwner(GameObject obj)

True if this player owns obj.

GetPlayerCount​

static int GetPlayerCount()

The number of players in the room.

GetPlayers​

static StageTimePlayer[] GetPlayers(StageTimePlayer[] players)

Fills players with the players in the room and returns it (resize it to GetPlayerCount first).

GetPlayerById​

static StageTimePlayer GetPlayerById(int id)

The player with id, or null.