VRC SDK
This project aims to completely document the VRChat Unity SDK
Loading...
Searching...
No Matches
VRC.SDKBase.VRCPlayerApi Class Reference

You can interact with Players in your world through the VRCPlayerApi. Each Player has a VRCPlayerApi Object. The VRCPlayerApi Class also has static methods for getting various information about Players in the instance. More...

Inheritance diagram for VRC.SDKBase.VRCPlayerApi:
Collaboration diagram for VRC.SDKBase.VRCPlayerApi:

Classes

struct  TrackingData
 A struct containing separate Position and Rotation data relating to a player's tracking More...
 

Public Types

enum  TrackingDataType : Enum
 The specific type of tracking data to get, IE hand position, head position, etc. More...
 

Public Member Functions

delegate void SetAnimatorBoolDelegate (VRCPlayerApi player, string name, bool value)
 
delegate void ClaimNetworkControlDelegate (VRCPlayerApi player, VRC_ObjectApi obj)
 
delegate Ray GetLookRayDelegate (VRCPlayerApi player)
 
delegate bool BoolDelegate (VRCPlayerApi player)
 
delegate void Action< T1, T2, T3, T4, T5 > (T1 p1, T2 p2, T3 p3, T4 p4, T5 p5)
 
bool IsPlayerGrounded ()
 Get whether the player is touching the ground, which enables Jump. More...
 
bool IsValid ()
 If a player has left since you saved a reference to them, this will return False. More...
 
bool IsOwner (GameObject obj)
 Tells you whether a Player is the Owner of a given GameObject, important for Sync. More...
 
void TakeOwnership (GameObject obj)
 
TrackingData GetTrackingData (TrackingDataType tt)
 Gets a struct called TrackingData, which contains separate Position and Rotation data. More...
 
Transform GetBoneTransform (HumanBodyBones tt)
 Gets the transform of a bone in the Player's Avatar. Currently unusable in Udon, use VRC.SDKBase.VRCPlayerApi.GetBonePosition(UnityEngine.HumanBodyBones) and VRC.SDKBase.VRCPlayerApi.GetBoneRotation(UnityEngine.HumanBodyBones) instead. More...
 
Vector3 GetBonePosition (HumanBodyBones tt)
 Gets the position of the specified Bone in the Player's Avatar, or Vector3.Zero (0,0,0) if the bone does not exist. More...
 
Quaternion GetBoneRotation (HumanBodyBones tt)
 Gets the rotation of the specified Bone in the Player's Avatar, or Quaternion.Identity (0,0,0,1) if the bone does not exist. More...
 
VRC_Pickup GetPickupInHand (VRC_Pickup.PickupHand hand)
 Gets the pickup a Player is holding in the specified hand. Only works for the Local Player. More...
 
void SetPickupInHand (VRC_Pickup pickup, VRC_Pickup.PickupHand hand)
 
void PlayHapticEventInHand (VRC_Pickup.PickupHand hand, float duration, float amplitude, float frequency)
 Vibrate the Player's Haptic controllers if they have them. More...
 
void TeleportTo (Vector3 teleportPos, Quaternion teleportRot)
 Send a player to a new spot and specified rotation, unless a Station does not allow it. More...
 
void TeleportTo (Vector3 teleportPos, Quaternion teleportRot, VRC_SceneDescriptor.SpawnOrientation teleportOrientation)
 Send a player to a new spot and specified rotation, unless a Station does not allow it. More...
 
void TeleportTo (Vector3 teleportPos, Quaternion teleportRot, VRC_SceneDescriptor.SpawnOrientation teleportOrientation, bool lerpOnRemote)
 Send a player to a new spot and specified rotation, unless a Station does not allow it. More...
 
void Respawn ()
 Respawns the player More...
 
void Respawn (int spawnsIndex)
 Respawns the player More...
 
void EnablePickups (bool enable)
 Turn off the Player's ability to pickup and use VRCPickup objects in the world. This property is on by default, so you only need to use the method if you want to turn it off. More...
 
void SetNamePlateColor (Color col)
 
void RestoreNamePlateColor ()
 
void SetNamePlateVisibility (bool flag)
 
void RestoreNamePlateVisibility ()
 
void SetPlayerTag (string tagName, string tagValue="")
 Sets a string variable that you can look up later.
For example, you could set the "role" of a player in a cooking game to "chef" or "customer". Then you could GetPlayerTag for "role" and get back either "chef" or "customer". More...
 
string GetPlayerTag (string tagName)
 Gets the value of a tag that was set with SetPlayerTag. More...
 
List< int > GetPlayersWithTag (string tagName, string tagValue="")
 NOT CURRENTLY FUNCTIONAL! DO NOT USE, WILL THROW EXPOSURE EXCEPTION! More...
 
void ClearPlayerTags ()
 Remove all tags that you've set on this player. More...
 
void SetInvisibleToTagged (bool invisible, string tagName, string tagValue="")
 
void SetInvisibleToUntagged (bool invisible, string tagName, string tagValue="")
 
void SetSilencedToTagged (int level, string tagName, string tagValue="")
 
void SetSilencedToUntagged (int level, string tagName, string tagValue="")
 
void SetRunSpeed (float speed=4f)
 The speed at which a Player can run around your world. More...
 
void SetWalkSpeed (float speed=2f)
 The speed at which a Player can walk around your world. More...
 
void SetStrafeSpeed (float speed=2f)
 The speed at which a Player can strafe around your world. Players speed when strafing is not affected by running. More...
 
void SetJumpImpulse (float impulse=3f)
 How much force applied when a player jumps. Set this if you want to enable jump in your world. The default VRCWorld prefab sets this to 3. More...
 
float GetGravityStrength ()
 Multiplier for the Gravity force of the world (set to Earth's default). More...
 
float GetRunSpeed ()
 The speed at which a Player can run around your world. More...
 
float GetWalkSpeed ()
 The speed at which a Player can walk around your world. More...
 
float GetStrafeSpeed ()
 The speed at which a Player can strafe around your world. More...
 
float GetJumpImpulse ()
 How much force applied when a player jumps. More...
 
bool IsUserInVR ()
 Tells you whether a Player is using a VR headset. More...
 
void SetGravityStrength (float strength=1f)
 Multiplier for the Gravity force of the world (set to Earth's default). More...
 
void UseLegacyLocomotion ()
 WARNING: This method is not recommended to be used.
turns on legacy locomotion for this player. More...
 
void UseAttachedStation ()
 Makes the player get into the Station which is on the same GameObject as this UdonBehaviour. More...
 
void ClearInvisible ()
 
void ClearSilence ()
 
void AddToList ()
 
void RemoveFromList ()
 
void CombatSetup ()
 
void CombatSetMaxHitpoints (float maxHp)
 
void CombatSetCurrentHitpoints (float hp)
 
float CombatGetCurrentHitpoints ()
 NOT IMPLEMENTED AND NON-FUNCTIONAL! DO NOT USE! More...
 
void CombatSetRespawn (bool respawnOnDeath, float respawnTimer, Transform respawnLocation)
 
void CombatSetDamageGraphic (GameObject prefab)
 
IVRC_Destructible CombatGetDestructible ()
 
void SetVoiceGain (float gain)
 Add boost to the Player's voice in decibels. More...
 
float GetVoiceGain ()
 
void SetVoiceDistanceNear (float near)
 The near radius, in meters, where volume begins to fall off. It is strongly recommended to leave the Near value at zero for realism and effective spatialization for user voices. More...
 
float GetVoiceDistanceNear ()
 
void SetVoiceDistanceFar (float far)
 This sets the end of the range for hearing the user's voice. You can lower this to make another player's voice not travel as far, all the way to 0 to effectively 'mute' the player. More...
 
float GetVoiceDistanceFar ()
 
void SetVoiceVolumetricRadius (float radius)
 A player's voice is normally simulated to be a point source, however changing this value allows the source to appear to come from a larger area. More...
 
float GetVoiceVolumetricRadius ()
 
void SetVoiceLowpass (bool enabled)
 Disables the low-pass filter on the player's voice. More...
 
bool GetVoiceLowpass ()
 
void SetAvatarAudioGain (float gain)
 Set the Maximum Gain allowed on Avatar Audio. More...
 
void SetAvatarAudioFarRadius (float distance)
 This sets the maximum end of the range for hearing the avatar's audio. More...
 
void SetAvatarAudioNearRadius (float distance)
 This sets the minimum start of the range for hearing the avatar's audio. More...
 
void SetAvatarAudioVolumetricRadius (float radius)
 Set the Volumetric Radius of the Avatar's Audio. More...
 
void SetAvatarAudioForceSpatial (bool force)
 If this is on, then Spatialization is enabled for the source, and the spatialBlend is set to 1. More...
 
void SetAvatarAudioCustomCurve (bool allow)
 This sets whether the audio source should use a pre-configured custom curve?????? More...
 
GameObject[] GetPlayerObjects ()
 
Component FindComponentInPlayerObjects (Component referenceComponent)
 
void PushAnimations (RuntimeAnimatorController animations)
 
void PopAnimations ()
 
void Immobilize (bool immobile)
 Keeps a Player stuck in place, turning off their Locomotion. More...
 
void SetVelocity (Vector3 velocity)
 Set the speed and direction of the player's movement. More...
 
Vector3 GetVelocity ()
 Get the speed and direction of the player's movement. More...
 
Vector3 GetPosition ()
 Gets the position of the Player in world space. More...
 
Quaternion GetRotation ()
 Gets the rotation of the Player in world space. More...
 
float GetAvatarEyeHeightAsMeters ()
 Returns the configured eye height for the target player's avatar. This function works for the local player and remote players. More...
 
float GetAvatarEyeHeightMaximumAsMeters ()
 Returns the maximum eye height that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode. More...
 
float GetAvatarEyeHeightMinimumAsMeters ()
 Returns the minimum eye height in meters that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode. More...
 
bool GetManualAvatarScalingAllowed ()
 Checks if the local player is allowed to control their avatar scale. More...
 
void SetAvatarEyeHeightByMeters (float scaleMeters)
 Sets the eye height for the target player's avatar in meters. This function only works for the local player. More...
 
void SetAvatarEyeHeightByMultiplier (float scaleMultiplier)
 Sets the eye height using a multiplier of the target player's avatar eye height at its prefab scale. This function only works for the local player. More...
 
void SetAvatarEyeHeightMaximumByMeters (float scaleMeters)
 Sets the maximum eye height in meters that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode. More...
 
void SetAvatarEyeHeightMinimumByMeters (float scaleMeters)
 Sets the minimum height in meters that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode. More...
 
void SetManualAvatarScalingAllowed (bool enabled)
 Toggles between player-controlled and world-authoritative scaling modes. More...
 
bool IsValid ()
 

Static Public Member Functions

static VRCPlayerApi[] GetPlayers (VRCPlayerApi[] players)
 This is how you get all the Players in your world so you can go through them in a For Loop and apply settings, make changes, look for a particular name, etc. To use it, you first need to create a VRCPlayerApi Array.

This is how the method should be used to get the full list of players in a instance.
More...
 
static int GetPlayerCount ()
 Gets the number of Players in the instance when it is called. More...
 
static int GetPlayerId (VRCPlayerApi player)
 Gets the Player's Network Id from the source. More...
 
static VRCPlayerApi GetPlayerByGameObject (GameObject playerGameObject)
 
static VRCPlayerApi GetPlayerById (int playerId)
 Get a VRCPlayerApi object for the given player Id if it exists. More...
 
static string[] GetAvailableLanguages ()
 Gets all available languages a player can select, in RFC 5646 format. More...
 
static string GetCurrentLanguage ()
 Gets the selected language of the local user, in RFC 5646 format. More...
 

Public Attributes

bool isLocal = true
 Tells you whether the given Player is the local one. More...
 
string displayName = "<uninitialized>"
 Get the name displayed for the Player (can be different than Username, which is used to log into VRChat and not exposed publicly) More...
 
GameObject gameObject
 

Static Public Attributes

static SetAnimatorBoolDelegate SetAnimatorBool
 
static ClaimNetworkControlDelegate ClaimNetworkControl
 
static GetLookRayDelegate GetLookRay
 
static BoolDelegate IsGrounded
 
static List< VRCPlayerApisPlayers = new List<VRCPlayerApi>()
 

Properties

bool isMaster [get]
 Tells you whether the given Player is the instance master. More...
 
bool isInstanceOwner [get]
 If the player is the owner of the instance. This isnt as straightforward as it seems, and a table is provided to explain it.

Instance TypeWill be true for
PublicNever
Friends+Instance Creator
FriendsInstance Creator
Invite+Instance Creator
InviteInstance Creator
Group+Never
GroupNever
Group PublicNever

From testing and for future reference incase features are added, the name displayed when viewing a instance in instance details should be the "Instance Owner". More...

 
bool isModerator [get]
 if the player is a moderator. Currently unusable in udon More...
 
bool isSuper [get]
 if the player is a super user? Currently unusable in udon More...
 
bool isSuspended [get]
 
static List< VRCPlayerApiAllPlayers [get]
 Gets all the players in the instance as a list. Currently unusable in udon More...
 
int playerId [get]
 Get the cached PlayerId, calls GetPlayerId if it hasn't been cached yet. More...
 

Private Attributes

int mPlayerId = -1
 

Detailed Description

You can interact with Players in your world through the VRCPlayerApi. Each Player has a VRCPlayerApi Object. The VRCPlayerApi Class also has static methods for getting various information about Players in the instance.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1296 of file VRCSDKBase.cs.

Member Enumeration Documentation

◆ TrackingDataType

The specific type of tracking data to get, IE hand position, head position, etc.

IMPORTANT NOTE: If relating to a remote player, the value will be from the players bones, NOT their actual tracking data
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1311 of file VRCSDKBase.cs.

Member Function Documentation

◆ Action< T1, T2, T3, T4, T5 >()

delegate void VRC.SDKBase.VRCPlayerApi.Action< T1, T2, T3, T4, T5 > ( T1  p1,
T2  p2,
T3  p3,
T4  p4,
T5  p5 
)

◆ AddToList()

void VRC.SDKBase.VRCPlayerApi.AddToList ( )

Definition at line 2282 of file VRCSDKBase.cs.

◆ BoolDelegate()

delegate bool VRC.SDKBase.VRCPlayerApi.BoolDelegate ( VRCPlayerApi  player)

◆ ClaimNetworkControlDelegate()

delegate void VRC.SDKBase.VRCPlayerApi.ClaimNetworkControlDelegate ( VRCPlayerApi  player,
VRC_ObjectApi  obj 
)

◆ ClearInvisible()

void VRC.SDKBase.VRCPlayerApi.ClearInvisible ( )

Definition at line 2272 of file VRCSDKBase.cs.

◆ ClearPlayerTags()

void VRC.SDKBase.VRCPlayerApi.ClearPlayerTags ( )

Remove all tags that you've set on this player.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2081 of file VRCSDKBase.cs.

◆ ClearSilence()

void VRC.SDKBase.VRCPlayerApi.ClearSilence ( )

Definition at line 2277 of file VRCSDKBase.cs.

◆ CombatGetCurrentHitpoints()

float VRC.SDKBase.VRCPlayerApi.CombatGetCurrentHitpoints ( )

NOT IMPLEMENTED AND NON-FUNCTIONAL! DO NOT USE!


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2326 of file VRCSDKBase.cs.

◆ CombatGetDestructible()

IVRC_Destructible VRC.SDKBase.VRCPlayerApi.CombatGetDestructible ( )


Docs generated by the VRChat SDK Documentation Project.

Definition at line 2353 of file VRCSDKBase.cs.

◆ CombatSetCurrentHitpoints()

void VRC.SDKBase.VRCPlayerApi.CombatSetCurrentHitpoints ( float  hp)


Docs generated by the VRChat SDK Documentation Project.

Definition at line 2316 of file VRCSDKBase.cs.

◆ CombatSetDamageGraphic()

void VRC.SDKBase.VRCPlayerApi.CombatSetDamageGraphic ( GameObject  prefab)


Docs generated by the VRChat SDK Documentation Project.

Definition at line 2344 of file VRCSDKBase.cs.

◆ CombatSetMaxHitpoints()

void VRC.SDKBase.VRCPlayerApi.CombatSetMaxHitpoints ( float  maxHp)


Docs generated by the VRChat SDK Documentation Project.

Definition at line 2307 of file VRCSDKBase.cs.

◆ CombatSetRespawn()

void VRC.SDKBase.VRCPlayerApi.CombatSetRespawn ( bool  respawnOnDeath,
float  respawnTimer,
Transform  respawnLocation 
)


Docs generated by the VRChat SDK Documentation Project.

Definition at line 2335 of file VRCSDKBase.cs.

◆ CombatSetup()

void VRC.SDKBase.VRCPlayerApi.CombatSetup ( )


Docs generated by the VRChat SDK Documentation Project.

Definition at line 2298 of file VRCSDKBase.cs.

◆ EnablePickups()

void VRC.SDKBase.VRCPlayerApi.EnablePickups ( bool  enable)

Turn off the Player's ability to pickup and use VRCPickup objects in the world. This property is on by default, so you only need to use the method if you want to turn it off.

Parameters
enable
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1998 of file VRCSDKBase.cs.

◆ FindComponentInPlayerObjects()

Component VRC.SDKBase.VRCPlayerApi.FindComponentInPlayerObjects ( Component  referenceComponent)

Definition at line 2577 of file VRCSDKBase.cs.

Here is the call graph for this function:

◆ GetAvailableLanguages()

static string[] VRC.SDKBase.VRCPlayerApi.GetAvailableLanguages ( )
static

Gets all available languages a player can select, in RFC 5646 format.

Returns
Returns a string[] of all available languages a player can select, in RFC 5646 format.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2554 of file VRCSDKBase.cs.

◆ GetAvatarEyeHeightAsMeters()

float VRC.SDKBase.VRCPlayerApi.GetAvatarEyeHeightAsMeters ( )

Returns the configured eye height for the target player's avatar. This function works for the local player and remote players.

Returns
The avatar eye height in meters.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2671 of file VRCSDKBase.cs.

◆ GetAvatarEyeHeightMaximumAsMeters()

float VRC.SDKBase.VRCPlayerApi.GetAvatarEyeHeightMaximumAsMeters ( )

Returns the maximum eye height that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode.

Returns
The maximum avatar eye height in meters.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2685 of file VRCSDKBase.cs.

◆ GetAvatarEyeHeightMinimumAsMeters()

float VRC.SDKBase.VRCPlayerApi.GetAvatarEyeHeightMinimumAsMeters ( )

Returns the minimum eye height in meters that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode.

Returns
Greater than or equal to 0.2 meters.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2699 of file VRCSDKBase.cs.

◆ GetBonePosition()

Vector3 VRC.SDKBase.VRCPlayerApi.GetBonePosition ( HumanBodyBones  tt)

Gets the position of the specified Bone in the Player's Avatar, or Vector3.Zero (0,0,0) if the bone does not exist.

Warning! This information can be frustrum-culled on remote players and may not be accurate if the local player cannot see the remote player. Note that Avatars may not have all the same bones in the places you expect, so be careful making assumptions about attributes like a player's height, pose etc based on the position of bones.

Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
ttThe bone to get the position of. see UnityEngine.HumanBodyBones for a list of all bones you can check for.
Returns
The position of the specified bone in the player's avatar in world space. Vector3.Zero (0,0,0) if the bone does not exist.

Definition at line 1821 of file VRCSDKBase.cs.

◆ GetBoneRotation()

Quaternion VRC.SDKBase.VRCPlayerApi.GetBoneRotation ( HumanBodyBones  tt)

Gets the rotation of the specified Bone in the Player's Avatar, or Quaternion.Identity (0,0,0,1) if the bone does not exist.

Warning! This information can be frustrum-culled on remote players and may not be accurate if the local player cannot see the remote player. Note that Avatars may not have all the same bones in the places you expect, so be careful making assumptions about attributes like a player's height, pose etc based on the rotation of bones. Things like wrist rotation, or forward axis's of a hand have no set standard, so for one avatar it may be +X, for another it may be -Z. The only reliable rotation is from VRC.SDKBase.VRCPlayerApi.GetTrackingData(VRC.SDKBase.VRCPlayerApi.TrackingDataType), however this only works on local players, so may require a more complex setup depending on your application.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
ttThe bone to get the rotation of. see UnityEngine.HumanBodyBones for a list of all bones you can check for.
Returns
The rotation of the specified bone in the player's avatar in world space. Quaternion.Identity (0,0,0,1) if the bone does not exist.

Definition at line 1845 of file VRCSDKBase.cs.

◆ GetBoneTransform()

Transform VRC.SDKBase.VRCPlayerApi.GetBoneTransform ( HumanBodyBones  tt)

Gets the transform of a bone in the Player's Avatar. Currently unusable in Udon, use VRC.SDKBase.VRCPlayerApi.GetBonePosition(UnityEngine.HumanBodyBones) and VRC.SDKBase.VRCPlayerApi.GetBoneRotation(UnityEngine.HumanBodyBones) instead.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1801 of file VRCSDKBase.cs.

◆ GetCurrentLanguage()

static string VRC.SDKBase.VRCPlayerApi.GetCurrentLanguage ( )
static

Gets the selected language of the local user, in RFC 5646 format.

Returns
The selected language of the local user, in RFC 5646 format.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2567 of file VRCSDKBase.cs.

◆ GetGravityStrength()

float VRC.SDKBase.VRCPlayerApi.GetGravityStrength ( )

Multiplier for the Gravity force of the world (set to Earth's default).

Returns
The gravity strength of the player. Default is 1.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2169 of file VRCSDKBase.cs.

◆ GetJumpImpulse()

float VRC.SDKBase.VRCPlayerApi.GetJumpImpulse ( )

How much force applied when a player jumps.

Returns
The jump impulse of the player. Default is 0.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2221 of file VRCSDKBase.cs.

◆ GetLookRayDelegate()

delegate Ray VRC.SDKBase.VRCPlayerApi.GetLookRayDelegate ( VRCPlayerApi  player)

◆ GetManualAvatarScalingAllowed()

bool VRC.SDKBase.VRCPlayerApi.GetManualAvatarScalingAllowed ( )

Checks if the local player is allowed to control their avatar scale.

Returns
if the local player is in the player-controlled avatar scaling mode, or false if they're in the world-authoritative avatar scaling mode.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2713 of file VRCSDKBase.cs.

◆ GetPickupInHand()

VRC_Pickup VRC.SDKBase.VRCPlayerApi.GetPickupInHand ( VRC_Pickup.PickupHand  hand)

Gets the pickup a Player is holding in the specified hand. Only works for the Local Player.

Parameters
handThe hand to check for a pickup. T:VRC.SDKBase.VRC_Pickup.PickupHand. Any is not supported.
Returns
The VRC.SDKBase.VRC_Pickup object the player is holding in the specified hand. Returns null if no VRCPickup is found.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1861 of file VRCSDKBase.cs.

◆ GetPlayerByGameObject()

static VRCPlayerApi VRC.SDKBase.VRCPlayerApi.GetPlayerByGameObject ( GameObject  playerGameObject)
static

Definition at line 1715 of file VRCSDKBase.cs.

◆ GetPlayerById()

static VRCPlayerApi VRC.SDKBase.VRCPlayerApi.GetPlayerById ( int  playerId)
static

Get a VRCPlayerApi object for the given player Id if it exists.

Parameters
playerIdThe player Id to get the VRCPlayerApi object for.
Returns
The VRCPlayerApi object for the given player Id if it exists, null otherwise.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1731 of file VRCSDKBase.cs.

Here is the caller graph for this function:

◆ GetPlayerCount()

static int VRC.SDKBase.VRCPlayerApi.GetPlayerCount ( )
static

Gets the number of Players in the instance when it is called.

Returns
The number of players in the instance.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1693 of file VRCSDKBase.cs.

◆ GetPlayerId()

static int VRC.SDKBase.VRCPlayerApi.GetPlayerId ( VRCPlayerApi  player)
static

Gets the Player's Network Id from the source.

Parameters
playerThe player to get the Network Id for.
Returns
The Network Id of the player. Always increments, even if the player leaves and rejoins.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1710 of file VRCSDKBase.cs.

◆ GetPlayerObjects()

GameObject[] VRC.SDKBase.VRCPlayerApi.GetPlayerObjects ( )

Definition at line 2572 of file VRCSDKBase.cs.

Here is the call graph for this function:

◆ GetPlayers()

static VRCPlayerApi[] VRC.SDKBase.VRCPlayerApi.GetPlayers ( VRCPlayerApi[]  players)
static

This is how you get all the Players in your world so you can go through them in a For Loop and apply settings, make changes, look for a particular name, etc. To use it, you first need to create a VRCPlayerApi Array.

This is how the method should be used to get the full list of players in a instance.

VRCPlayerApi[] players = new VRCPlayerApi[VRCPlayerApi.GetPlayerCount()];
VRCPlayerApi.GetPlayers(players);

Returns
The populated VRCPlayerApi Array.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1679 of file VRCSDKBase.cs.

◆ GetPlayersWithTag()

List< int > VRC.SDKBase.VRCPlayerApi.GetPlayersWithTag ( string  tagName,
string  tagValue = "" 
)

NOT CURRENTLY FUNCTIONAL! DO NOT USE, WILL THROW EXPOSURE EXCEPTION!

Parameters
tagNameThe name of the tag to get the players for.
tagValueThe value of the tag to get the players for?????????
Unknown if this is even what it does.
Returns
A list type of VRCPlayerApi objects that have the tag set.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2071 of file VRCSDKBase.cs.

◆ GetPlayerTag()

string VRC.SDKBase.VRCPlayerApi.GetPlayerTag ( string  tagName)

Gets the value of a tag that was set with SetPlayerTag.

Parameters
tagNameThe name of the tag to set.
Returns
The value of the tag as a string.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2053 of file VRCSDKBase.cs.

◆ GetPosition()

Vector3 VRC.SDKBase.VRCPlayerApi.GetPosition ( )

Gets the position of the Player in world space.

Returns
The position of the player in world space.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2642 of file VRCSDKBase.cs.

◆ GetRotation()

Quaternion VRC.SDKBase.VRCPlayerApi.GetRotation ( )

Gets the rotation of the Player in world space.

Returns
The rotation of the player in world space.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2656 of file VRCSDKBase.cs.

◆ GetRunSpeed()

float VRC.SDKBase.VRCPlayerApi.GetRunSpeed ( )

The speed at which a Player can run around your world.

Returns
The run speed of the player.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2182 of file VRCSDKBase.cs.

◆ GetStrafeSpeed()

float VRC.SDKBase.VRCPlayerApi.GetStrafeSpeed ( )

The speed at which a Player can strafe around your world.

Returns
The strafe speed of the player.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2208 of file VRCSDKBase.cs.

◆ GetTrackingData()

TrackingData VRC.SDKBase.VRCPlayerApi.GetTrackingData ( TrackingDataType  tt)

Gets a struct called TrackingData, which contains separate Position and Rotation data.

Warning! This information can be frustrum-culled on remote players and may not be accurate if the local player cannot see the remote player. This is the suggested way to get position and rotation data for a Player's head and hands. This returns data from the TrackingManager for a Local Player (ie the data coming from their headset / trackers) and from the RightHand, LeftHand and Head bones for a Remote Player. Origin returns the center of the local VR user's playspace, while returning the player's position for local Desktop users and all remote users. AvatarRoot returns data for the root transform of the avatar (the same transform that the player capsule is attached to). For users in Fully-Body Tracking, AvatarRoot will not rotate with the head facing direction. If you need data reflecting the general forward facing direction of a Player, consider using GetRotation instead.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
ttThe type of tracking data to get. VRC.SDKBase.VRCPlayerApi.TrackingDataType
Returns
The tracking data for the specified type. IMPORTANT WARNING: The returned tracking data will contain bone position/rotation if used on remote players when asking for things like controller position! The tracking data is only correct if used on the local player.

Definition at line 1791 of file VRCSDKBase.cs.

◆ GetVelocity()

Vector3 VRC.SDKBase.VRCPlayerApi.GetVelocity ( )

Get the speed and direction of the player's movement.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Returns
The velocity vector of the player in world space.

Definition at line 2628 of file VRCSDKBase.cs.

◆ GetVoiceDistanceFar()

float VRC.SDKBase.VRCPlayerApi.GetVoiceDistanceFar ( )

Definition at line 2411 of file VRCSDKBase.cs.

◆ GetVoiceDistanceNear()

float VRC.SDKBase.VRCPlayerApi.GetVoiceDistanceNear ( )

Definition at line 2391 of file VRCSDKBase.cs.

◆ GetVoiceGain()

float VRC.SDKBase.VRCPlayerApi.GetVoiceGain ( )

Definition at line 2371 of file VRCSDKBase.cs.

◆ GetVoiceLowpass()

bool VRC.SDKBase.VRCPlayerApi.GetVoiceLowpass ( )

Definition at line 2455 of file VRCSDKBase.cs.

◆ GetVoiceVolumetricRadius()

float VRC.SDKBase.VRCPlayerApi.GetVoiceVolumetricRadius ( )

Definition at line 2435 of file VRCSDKBase.cs.

◆ GetWalkSpeed()

float VRC.SDKBase.VRCPlayerApi.GetWalkSpeed ( )

The speed at which a Player can walk around your world.

Returns
The walk speed of the player.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2195 of file VRCSDKBase.cs.

◆ Immobilize()

void VRC.SDKBase.VRCPlayerApi.Immobilize ( bool  immobile)

Keeps a Player stuck in place, turning off their Locomotion.

Note that VR Players may be able to move their viewpoint around a bit anyways, but their Avatar will stay in place.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
immobileTrue to immobilize the player, false to unimmobilize them.

Definition at line 2600 of file VRCSDKBase.cs.

◆ IsOwner()

bool VRC.SDKBase.VRCPlayerApi.IsOwner ( GameObject  obj)

Tells you whether a Player is the Owner of a given GameObject, important for Sync.

Parameters
objThe GameObject to check ownership of.
Returns
True if the player is the owner of the GameObject, false if they are not.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1760 of file VRCSDKBase.cs.

◆ IsPlayerGrounded()

bool VRC.SDKBase.VRCPlayerApi.IsPlayerGrounded ( )

Get whether the player is touching the ground, which enables Jump.

This value is not reliable if the player is in a station
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Returns
True if the player is touching the ground, false if they are not.

Definition at line 1659 of file VRCSDKBase.cs.

◆ IsUserInVR()

bool VRC.SDKBase.VRCPlayerApi.IsUserInVR ( )

Tells you whether a Player is using a VR headset.

Returns
True if the player is using a VR headset, false if they are not.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2234 of file VRCSDKBase.cs.

◆ IsValid()

bool VRC.SDKBase.VRCPlayerApi.IsValid ( )

If a player has left since you saved a reference to them, this will return False.

Returns
True if the player is valid to use, false if it is not.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Implements VRC.SDKBase.IValidChecker.

Definition at line 1744 of file VRCSDKBase.cs.

◆ PlayHapticEventInHand()

void VRC.SDKBase.VRCPlayerApi.PlayHapticEventInHand ( VRC_Pickup.PickupHand  hand,
float  duration,
float  amplitude,
float  frequency 
)

Vibrate the Player's Haptic controllers if they have them.

The feeling can vary quite a bit between controllers.
All 3 parameters MUST be positive.

Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
handThe hand to vibrate. VRC.SDKBase.VRC_Pickup.PickupHand .
durationThe duration of the vibration in seconds.
amplitudeThe amplitude of the vibration. 0.0 to 1.0.
frequencyThe frequency of the vibration. 0.0 to 1.0.

Definition at line 1885 of file VRCSDKBase.cs.

◆ PopAnimations()

void VRC.SDKBase.VRCPlayerApi.PopAnimations ( )

Definition at line 2587 of file VRCSDKBase.cs.

◆ PushAnimations()

void VRC.SDKBase.VRCPlayerApi.PushAnimations ( RuntimeAnimatorController  animations)

Definition at line 2582 of file VRCSDKBase.cs.

◆ RemoveFromList()

void VRC.SDKBase.VRCPlayerApi.RemoveFromList ( )

Definition at line 2288 of file VRCSDKBase.cs.

◆ Respawn() [1/2]

void VRC.SDKBase.VRCPlayerApi.Respawn ( )

Respawns the player


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1972 of file VRCSDKBase.cs.

◆ Respawn() [2/2]

void VRC.SDKBase.VRCPlayerApi.Respawn ( int  spawnsIndex)

Respawns the player

Parameters
spawnsIndexThe index of the respawn point to use


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1985 of file VRCSDKBase.cs.

◆ RestoreNamePlateColor()

void VRC.SDKBase.VRCPlayerApi.RestoreNamePlateColor ( )

Definition at line 2009 of file VRCSDKBase.cs.

◆ RestoreNamePlateVisibility()

void VRC.SDKBase.VRCPlayerApi.RestoreNamePlateVisibility ( )

Definition at line 2019 of file VRCSDKBase.cs.

◆ SetAnimatorBoolDelegate()

delegate void VRC.SDKBase.VRCPlayerApi.SetAnimatorBoolDelegate ( VRCPlayerApi  player,
string  name,
bool  value 
)

◆ SetAvatarAudioCustomCurve()

void VRC.SDKBase.VRCPlayerApi.SetAvatarAudioCustomCurve ( bool  allow)

This sets whether the audio source should use a pre-configured custom curve??????

Parameters
allowTrue to enable the custom curve, false to disable it. Default is false.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2541 of file VRCSDKBase.cs.

◆ SetAvatarAudioFarRadius()

void VRC.SDKBase.VRCPlayerApi.SetAvatarAudioFarRadius ( float  distance)

This sets the maximum end of the range for hearing the avatar's audio.

You can lower this to make another player's avatar audio not travel as far, all the way to 0 to effectively 'mute' the player. Note that this is compared to the audio source's maxDistance, and the smaller value is used.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
distancein Meters, Range 0 - Single.MaxValue. Default is 40.

Definition at line 2482 of file VRCSDKBase.cs.

◆ SetAvatarAudioForceSpatial()

void VRC.SDKBase.VRCPlayerApi.SetAvatarAudioForceSpatial ( bool  force)

If this is on, then Spatialization is enabled for the source, and the spatialBlend is set to 1.

Parameters
forceTrue to enable spatialization, false to disable it. Default is false.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2528 of file VRCSDKBase.cs.

◆ SetAvatarAudioGain()

void VRC.SDKBase.VRCPlayerApi.SetAvatarAudioGain ( float  gain)

Set the Maximum Gain allowed on Avatar Audio.

Parameters
gainin Decibels, Range 0-10. Default is 10.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2468 of file VRCSDKBase.cs.

◆ SetAvatarAudioNearRadius()

void VRC.SDKBase.VRCPlayerApi.SetAvatarAudioNearRadius ( float  distance)

This sets the minimum start of the range for hearing the avatar's audio.

An avatar's audio source is normally simulated to be a point source, however changing this value allows the source to appear to come from a larger area. This should be used carefully, and is mainly for distant audio sources that need to sound "large" as you move past them. Keep this at zero unless you know what you're doing. The value for Volumetric Radius should always be lower than Avatar AudioFarRadius. Default is 0 meters.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
distancein Meters, Range 0 - Single.MaxValue. Default is 0.

Definition at line 2499 of file VRCSDKBase.cs.

◆ SetAvatarAudioVolumetricRadius()

void VRC.SDKBase.VRCPlayerApi.SetAvatarAudioVolumetricRadius ( float  radius)

Set the Volumetric Radius of the Avatar's Audio.

An avatar's audio source is normally simulated to be a point source, however changing this value allows the source to appear to come from a larger area. This should be used carefully, and is mainly for distant audio sources that need to sound "large" as you move past them. Keep this at zero unless you know what you're doing. The value for Volumetric Radius should always be lower than VRC.SDKBase.VRCPlayerApi.SetAvatarAudioFarRadius(System.Single).
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
distancein Meters, Range 0 - Single.MaxValue. Default is 0.

Definition at line 2514 of file VRCSDKBase.cs.

◆ SetAvatarEyeHeightByMeters()

void VRC.SDKBase.VRCPlayerApi.SetAvatarEyeHeightByMeters ( float  scaleMeters)

Sets the eye height for the target player's avatar in meters. This function only works for the local player.

Parameters
scaleMetersThe avatar eye height in meters.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2727 of file VRCSDKBase.cs.

◆ SetAvatarEyeHeightByMultiplier()

void VRC.SDKBase.VRCPlayerApi.SetAvatarEyeHeightByMultiplier ( float  scaleMultiplier)

Sets the eye height using a multiplier of the target player's avatar eye height at its prefab scale. This function only works for the local player.

Parameters
scaleMultiplierThe avatar eye height as a multiple of the target player's avatar eye height at its prefab scale.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2742 of file VRCSDKBase.cs.

◆ SetAvatarEyeHeightMaximumByMeters()

void VRC.SDKBase.VRCPlayerApi.SetAvatarEyeHeightMaximumByMeters ( float  scaleMeters)

Sets the maximum eye height in meters that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode.

Parameters
scaleMetersMust be less or equal to 5 meters.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2756 of file VRCSDKBase.cs.

◆ SetAvatarEyeHeightMinimumByMeters()

void VRC.SDKBase.VRCPlayerApi.SetAvatarEyeHeightMinimumByMeters ( float  scaleMeters)

Sets the minimum height in meters that the local player is permitted to scale themselves to in the player-controlled avatar scaling mode.

Parameters
scaleMetersMust be greater than or equal to 0.2 meters.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2770 of file VRCSDKBase.cs.

◆ SetGravityStrength()

void VRC.SDKBase.VRCPlayerApi.SetGravityStrength ( float  strength = 1f)

Multiplier for the Gravity force of the world (set to Earth's default).

Don't change Unity's Physics.Gravity in your project, get and set it here instead if you are trying to affect the player.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
strengthThe gravity strength of the player. Default is 1.

Definition at line 2247 of file VRCSDKBase.cs.

◆ SetInvisibleToTagged()

void VRC.SDKBase.VRCPlayerApi.SetInvisibleToTagged ( bool  invisible,
string  tagName,
string  tagValue = "" 
)

Definition at line 2086 of file VRCSDKBase.cs.

◆ SetInvisibleToUntagged()

void VRC.SDKBase.VRCPlayerApi.SetInvisibleToUntagged ( bool  invisible,
string  tagName,
string  tagValue = "" 
)

Definition at line 2091 of file VRCSDKBase.cs.

◆ SetJumpImpulse()

void VRC.SDKBase.VRCPlayerApi.SetJumpImpulse ( float  impulse = 3f)

How much force applied when a player jumps. Set this if you want to enable jump in your world. The default VRCWorld prefab sets this to 3.

Parameters
impulseThe jump impulse of the player. Default is 0.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2156 of file VRCSDKBase.cs.

◆ SetManualAvatarScalingAllowed()

void VRC.SDKBase.VRCPlayerApi.SetManualAvatarScalingAllowed ( bool  enabled)

Toggles between player-controlled and world-authoritative scaling modes.

Parameters
enabledtrue sets the player-controlled mode, and false sets the world-authoritative mode.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2783 of file VRCSDKBase.cs.

◆ SetNamePlateColor()

void VRC.SDKBase.VRCPlayerApi.SetNamePlateColor ( Color  col)

Definition at line 2003 of file VRCSDKBase.cs.

◆ SetNamePlateVisibility()

void VRC.SDKBase.VRCPlayerApi.SetNamePlateVisibility ( bool  flag)

Definition at line 2014 of file VRCSDKBase.cs.

◆ SetPickupInHand()

void VRC.SDKBase.VRCPlayerApi.SetPickupInHand ( VRC_Pickup  pickup,
VRC_Pickup.PickupHand  hand 
)

Definition at line 1866 of file VRCSDKBase.cs.

◆ SetPlayerTag()

void VRC.SDKBase.VRCPlayerApi.SetPlayerTag ( string  tagName,
string  tagValue = "" 
)

Sets a string variable that you can look up later.
For example, you could set the "role" of a player in a cooking game to "chef" or "customer". Then you could GetPlayerTag for "role" and get back either "chef" or "customer".

Parameters
tagNameThe name of the tag to set.
tagValueThe value of the tag to set.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2037 of file VRCSDKBase.cs.

◆ SetRunSpeed()

void VRC.SDKBase.VRCPlayerApi.SetRunSpeed ( float  speed = 4f)

The speed at which a Player can run around your world.

Parameters
speedThe run speed of the player. Set this above your walk Speed. Default is 4.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2114 of file VRCSDKBase.cs.

◆ SetSilencedToTagged()

void VRC.SDKBase.VRCPlayerApi.SetSilencedToTagged ( int  level,
string  tagName,
string  tagValue = "" 
)

Definition at line 2096 of file VRCSDKBase.cs.

◆ SetSilencedToUntagged()

void VRC.SDKBase.VRCPlayerApi.SetSilencedToUntagged ( int  level,
string  tagName,
string  tagValue = "" 
)

Definition at line 2101 of file VRCSDKBase.cs.

◆ SetStrafeSpeed()

void VRC.SDKBase.VRCPlayerApi.SetStrafeSpeed ( float  speed = 2f)

The speed at which a Player can strafe around your world. Players speed when strafing is not affected by running.

Parameters
speedThe strafe speed of the player. Recommended to be set to the same as Walk Speed. Default is 2.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2142 of file VRCSDKBase.cs.

◆ SetVelocity()

void VRC.SDKBase.VRCPlayerApi.SetVelocity ( Vector3  velocity)

Set the speed and direction of the player's movement.

If SetVelocity is called on the local player, their 'IsGrounded' property is set to false since they are not in direct control of their movements while this is happening.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
velocityThe velocity vector to set the player to.

Definition at line 2614 of file VRCSDKBase.cs.

◆ SetVoiceDistanceFar()

void VRC.SDKBase.VRCPlayerApi.SetVoiceDistanceFar ( float  far)

This sets the end of the range for hearing the user's voice. You can lower this to make another player's voice not travel as far, all the way to 0 to effectively 'mute' the player.

Parameters
farin Meters, Range 0 - 1,000,000. Default is 25.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2406 of file VRCSDKBase.cs.

◆ SetVoiceDistanceNear()

void VRC.SDKBase.VRCPlayerApi.SetVoiceDistanceNear ( float  near)

The near radius, in meters, where volume begins to fall off. It is strongly recommended to leave the Near value at zero for realism and effective spatialization for user voices.

Parameters
nearin Meters, Range 0 - 1,000,000. Default is ???.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2386 of file VRCSDKBase.cs.

◆ SetVoiceGain()

void VRC.SDKBase.VRCPlayerApi.SetVoiceGain ( float  gain)

Add boost to the Player's voice in decibels.

Parameters
gainin Decibels, Range 0-24. Default is 15.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2366 of file VRCSDKBase.cs.

◆ SetVoiceLowpass()

void VRC.SDKBase.VRCPlayerApi.SetVoiceLowpass ( bool  enabled)

Disables the low-pass filter on the player's voice.

When a voice is some distance off, it is passed through a low-pass filter to help with understanding noisy worlds. You can disable this if you want to skip this filter. For example, if you intend for a player to use their voice channel to play a high-quality DJ mix, turning this filter off is advisable.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
enabledTrue to enable? the low-pass filter, false? to disable it.

Definition at line 2450 of file VRCSDKBase.cs.

◆ SetVoiceVolumetricRadius()

void VRC.SDKBase.VRCPlayerApi.SetVoiceVolumetricRadius ( float  radius)

A player's voice is normally simulated to be a point source, however changing this value allows the source to appear to come from a larger area.

This should be used carefully, and is mainly for distant audio sources that need to sound "large" as you move past them. Keep this at zero unless you know what you're doing. If you want a user's voice to sound like it is close no matter how far it is, increase the Voice Distance Near range to a large value.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Parameters
radiusin Meters, Range is 0 - 1,000. Default is 0. The value for Volumetric Radius should always be lower than Voice Distance Far.

Definition at line 2430 of file VRCSDKBase.cs.

◆ SetWalkSpeed()

void VRC.SDKBase.VRCPlayerApi.SetWalkSpeed ( float  speed = 2f)

The speed at which a Player can walk around your world.

Parameters
speedThe walk speed of the player. Set this below your Run Speed. Default is 2.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2127 of file VRCSDKBase.cs.

◆ TakeOwnership()

void VRC.SDKBase.VRCPlayerApi.TakeOwnership ( GameObject  obj)

Definition at line 1765 of file VRCSDKBase.cs.

◆ TeleportTo() [1/3]

void VRC.SDKBase.VRCPlayerApi.TeleportTo ( Vector3  teleportPos,
Quaternion  teleportRot 
)

Send a player to a new spot and specified rotation, unless a Station does not allow it.

Parameters
teleportPosThe position to teleport the player to in world space.
teleportRotThe rotation to teleport the player to in world space.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1904 of file VRCSDKBase.cs.

◆ TeleportTo() [2/3]

void VRC.SDKBase.VRCPlayerApi.TeleportTo ( Vector3  teleportPos,
Quaternion  teleportRot,
VRC_SceneDescriptor.SpawnOrientation  teleportOrientation 
)

Send a player to a new spot and specified rotation, unless a Station does not allow it.

Parameters
teleportPosThe position to teleport the player to in world space.
teleportRotThe rotation to teleport the player to in world space.
teleportOrientationHow to align players with the destination position and rotation. VRC.SDKBase.VRC_SceneDescriptor.SpawnOrientation


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1927 of file VRCSDKBase.cs.

◆ TeleportTo() [3/3]

void VRC.SDKBase.VRCPlayerApi.TeleportTo ( Vector3  teleportPos,
Quaternion  teleportRot,
VRC_SceneDescriptor.SpawnOrientation  teleportOrientation,
bool  lerpOnRemote 
)

Send a player to a new spot and specified rotation, unless a Station does not allow it.

Parameters
teleportPosThe position to teleport the player to in world space.
teleportRotThe rotation to teleport the player to in world space.
teleportOrientationHow to align players with the destination position and rotation. VRC.SDKBase.VRC_SceneDescriptor.SpawnOrientation
lerpOnRemoteWhether to interpolate the player's movement. If true, the teleportation is instantaneous and incurs and additional network bandwidth cost. If false, the teleportation is treated as normal player movement.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1957 of file VRCSDKBase.cs.

◆ UseAttachedStation()

void VRC.SDKBase.VRCPlayerApi.UseAttachedStation ( )

Makes the player get into the Station which is on the same GameObject as this UdonBehaviour.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2267 of file VRCSDKBase.cs.

◆ UseLegacyLocomotion()

void VRC.SDKBase.VRCPlayerApi.UseLegacyLocomotion ( )

WARNING: This method is not recommended to be used.
turns on legacy locomotion for this player.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 2256 of file VRCSDKBase.cs.

Member Data Documentation

◆ ClaimNetworkControl

ClaimNetworkControlDelegate VRC.SDKBase.VRCPlayerApi.ClaimNetworkControl
static

Definition at line 1409 of file VRCSDKBase.cs.

◆ displayName

string VRC.SDKBase.VRCPlayerApi.displayName = "<uninitialized>"

Get the name displayed for the Player (can be different than Username, which is used to log into VRChat and not exposed publicly)

This value may return the string: "<![CDATA[&lt;uninitialized&gt;]]>" if the player is not valid in clientsim.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1405 of file VRCSDKBase.cs.

◆ gameObject

GameObject VRC.SDKBase.VRCPlayerApi.gameObject

Definition at line 1571 of file VRCSDKBase.cs.

◆ GetLookRay

GetLookRayDelegate VRC.SDKBase.VRCPlayerApi.GetLookRay
static

Definition at line 1411 of file VRCSDKBase.cs.

◆ IsGrounded

BoolDelegate VRC.SDKBase.VRCPlayerApi.IsGrounded
static

Definition at line 1413 of file VRCSDKBase.cs.

◆ isLocal

bool VRC.SDKBase.VRCPlayerApi.isLocal = true

Tells you whether the given Player is the local one.


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1398 of file VRCSDKBase.cs.

◆ mPlayerId

int VRC.SDKBase.VRCPlayerApi.mPlayerId = -1
private

Definition at line 1417 of file VRCSDKBase.cs.

◆ SetAnimatorBool

SetAnimatorBoolDelegate VRC.SDKBase.VRCPlayerApi.SetAnimatorBool
static

Definition at line 1407 of file VRCSDKBase.cs.

◆ sPlayers

List<VRCPlayerApi> VRC.SDKBase.VRCPlayerApi.sPlayers = new List<VRCPlayerApi>()
static

Definition at line 1415 of file VRCSDKBase.cs.

Property Documentation

◆ AllPlayers

List<VRCPlayerApi> VRC.SDKBase.VRCPlayerApi.AllPlayers
staticget

Gets all the players in the instance as a list. Currently unusable in udon


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1630 of file VRCSDKBase.cs.

◆ isInstanceOwner

bool VRC.SDKBase.VRCPlayerApi.isInstanceOwner
get

If the player is the owner of the instance. This isnt as straightforward as it seems, and a table is provided to explain it.

Instance TypeWill be true for
PublicNever
Friends+Instance Creator
FriendsInstance Creator
Invite+Instance Creator
InviteInstance Creator
Group+Never
GroupNever
Group PublicNever

From testing and for future reference incase features are added, the name displayed when viewing a instance in instance details should be the "Instance Owner".

Will be False when in Build & Test and Unity Playmode.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1607 of file VRCSDKBase.cs.

◆ isMaster

bool VRC.SDKBase.VRCPlayerApi.isMaster
get

Tells you whether the given Player is the instance master.

This is the player who either created the instance, or the one who inherited Master status when the last Master left.
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1598 of file VRCSDKBase.cs.

◆ isModerator

bool VRC.SDKBase.VRCPlayerApi.isModerator
get

if the player is a moderator. Currently unusable in udon


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1614 of file VRCSDKBase.cs.

◆ isSuper

bool VRC.SDKBase.VRCPlayerApi.isSuper
get

if the player is a super user? Currently unusable in udon


Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

Definition at line 1621 of file VRCSDKBase.cs.

◆ isSuspended

bool VRC.SDKBase.VRCPlayerApi.isSuspended
get

Definition at line 1623 of file VRCSDKBase.cs.

◆ playerId

int VRC.SDKBase.VRCPlayerApi.playerId
get

Get the cached PlayerId, calls GetPlayerId if it hasn't been cached yet.

Currently, this seems to behave identically to VRC.SDKBase.VRCPlayerApi.GetPlayerId(VRC.SDKBase.VRCPlayerApi).
Check the VRChat documentation for more information.
Docs generated by the VRChat SDK Documentation Project.

The Network Id of the player. Always increments, even if the player leaves and rejoins.

Definition at line 1640 of file VRCSDKBase.cs.


The documentation for this class was generated from the following file: