Player
Represents a VRChat player in the instance. The Player API lets you read player information like display name and position, teleport players, modify movement settings, and check network roles like master or instance owner.
Properties
| Property | Type | Access |
|---|---|---|
| displayName | string | get |
| isInstanceOwner | bool | get |
| isLocal | bool | get |
| isMaster | bool | get |
| isSuspended | bool | get |
| playerId | int | get |
displayName
The player’s visible VRChat display name.
log("Welcome, {player.displayName}")isInstanceOwner
True if this player created the current VRChat instance.
let owner: bool = player.isInstanceOwnerisLocal
True if this player is the local user running this Udon script.
let local: bool = player.isLocalisMaster
True if this player is the current instance master (first player or next after master leaves).
let master: bool = player.isMasterplayerId
The unique integer ID assigned to this player for the current instance.
let id: int = player.playerIdMethods
ClearPlayerTags
ClearPlayerTags() -> voidClearSilence
ClearSilence() -> voidCombatGetCurrentHitpoints
CombatGetCurrentHitpoints() -> floatCombatGetDestructible
CombatGetDestructible() -> VRCSDKBaseIVRC_DestructibleCombatSetCurrentHitpoints
CombatSetCurrentHitpoints(hp: float) -> voidCombatSetDamageGraphic
CombatSetDamageGraphic(prefab: GameObject) -> voidCombatSetMaxHitpoints
CombatSetMaxHitpoints(maxHp: float) -> voidCombatSetRespawn
CombatSetRespawn(respawnOnDeath: bool, respawnTimer: float, respawnLocation: Transform) -> voidCombatSetup
CombatSetup() -> voidEnablePickups
EnablePickups(enable: bool) -> voidEnables or disables the player’s ability to pick up VRC_Pickup objects.
player.EnablePickups(false)Equals
Equals(obj: object) -> boolFindComponentInPlayerObjects
FindComponentInPlayerObjects(referenceComponent: UnityEngineComponent) -> UnityEngineComponentGetAvailableLanguages
static GetAvailableLanguages() -> string[]GetAvatarEyeHeightAsMeters
GetAvatarEyeHeightAsMeters() -> floatGetAvatarEyeHeightMaximumAsMeters
GetAvatarEyeHeightMaximumAsMeters() -> floatGetAvatarEyeHeightMinimumAsMeters
GetAvatarEyeHeightMinimumAsMeters() -> floatGetBonePosition
GetBonePosition(tt: UnityEngineHumanBodyBones) -> Vector3Returns the world position of a specific avatar bone (e.g., head, hand).
let headPos: Vector3 = player.GetBonePosition(HumanBodyBones.Head)GetBoneRotation
GetBoneRotation(tt: UnityEngineHumanBodyBones) -> QuaternionReturns the world rotation of a specific avatar bone.
let handRot: Quaternion = player.GetBoneRotation(HumanBodyBones.RightHand)GetCurrentLanguage
static GetCurrentLanguage() -> stringGetDrone
GetDrone() -> VRCSDKBaseVRCDroneApiGetGravityStrength
GetGravityStrength() -> floatGetHashCode
GetHashCode() -> intGetJumpImpulse
GetJumpImpulse() -> floatGetManualAvatarScalingAllowed
GetManualAvatarScalingAllowed() -> boolGetPickupInHand
GetPickupInHand(hand: VRCSDKBaseVRC_PickupPickupHand) -> VRCSDKBaseVRC_PickupGetPlayerById
static GetPlayerById(playerId: int) -> PlayerGetPlayerCount
static GetPlayerCount() -> intGetPlayerId
static GetPlayerId(player: Player) -> intGetPlayerObjects
GetPlayerObjects() -> GameObject[]GetPlayers
static GetPlayers(players: Player[]) -> Player[]GetPlayersWithTag
GetPlayersWithTag(tagName: string, tagValue: string) -> SystemCollectionsGenericList`1[[SystemInt32, mscorlib, Version=4000, Culture=neutral, PublicKeyToken=b77a5c561934e089]]GetPlayerTag
GetPlayerTag(tagName: string) -> stringGetPosition
GetPosition() -> Vector3Returns the player’s current world-space position.
let pos: Vector3 = player.GetPosition()GetRotation
GetRotation() -> QuaternionReturns the player’s current world-space rotation.
let rot: Quaternion = player.GetRotation()GetRunSpeed
GetRunSpeed() -> floatGetStrafeSpeed
GetStrafeSpeed() -> floatGetTrackingData
GetTrackingData(tt: VRCSDKBaseVRCPlayerApiTrackingDataType) -> VRCSDKBaseVRCPlayerApiTrackingDataGetType
GetType() -> SystemTypeGetVelocity
GetVelocity() -> Vector3GetVoiceDistanceFar
GetVoiceDistanceFar() -> floatGetVoiceDistanceNear
GetVoiceDistanceNear() -> floatGetVoiceGain
GetVoiceGain() -> floatGetVoiceLowpass
GetVoiceLowpass() -> boolGetVoiceVolumetricRadius
GetVoiceVolumetricRadius() -> floatGetWalkSpeed
GetWalkSpeed() -> floatImmobilize
Immobilize(immobile: bool) -> voidPrevents or allows the local player from moving. Pass true to freeze, false to unfreeze.
player.Immobilize(true)IsOwner
IsOwner(obj: GameObject) -> boolIsPlayerGrounded
IsPlayerGrounded() -> boolReturns true if the player is currently standing on a surface.
let grounded: bool = player.IsPlayerGrounded()IsUserInVR
IsUserInVR() -> boolReturns true if the player is using a VR headset (false for desktop users).
let vr: bool = player.IsUserInVR()IsValid
IsValid() -> boolPlayHapticEventInHand
PlayHapticEventInHand(hand: VRCSDKBaseVRC_PickupPickupHand, duration: float, amplitude: float, frequency: float) -> voidRespawn
Respawn(spawnsIndex: int) -> voidRespawn() -> voidSetAvatarAudioCustomCurve
SetAvatarAudioCustomCurve(allow: bool) -> voidSetAvatarAudioFarRadius
SetAvatarAudioFarRadius(distance: float) -> voidSetAvatarAudioForceSpatial
SetAvatarAudioForceSpatial(force: bool) -> voidSetAvatarAudioGain
SetAvatarAudioGain(gain: float) -> voidSetAvatarAudioNearRadius
SetAvatarAudioNearRadius(distance: float) -> voidSetAvatarAudioVolumetricRadius
SetAvatarAudioVolumetricRadius(radius: float) -> voidSetAvatarEyeHeightByMeters
SetAvatarEyeHeightByMeters(scaleMeters: float) -> voidSetAvatarEyeHeightByMultiplier
SetAvatarEyeHeightByMultiplier(scaleMultiplier: float) -> voidSetAvatarEyeHeightMaximumByMeters
SetAvatarEyeHeightMaximumByMeters(scaleMeters: float) -> voidSetAvatarEyeHeightMinimumByMeters
SetAvatarEyeHeightMinimumByMeters(scaleMeters: float) -> voidSetGravityStrength
SetGravityStrength(strength: float) -> voidSets the gravity multiplier for the player. 1 is normal, 0 is zero-gravity.
player.SetGravityStrength(0.5)SetJumpImpulse
SetJumpImpulse(impulse: float) -> voidSets the upward force applied when the player jumps.
player.SetJumpImpulse(5.0)SetManualAvatarScalingAllowed
SetManualAvatarScalingAllowed(enabled: bool) -> voidSetPlayerTag
SetPlayerTag(tagName: string, tagValue: string) -> voidSetRunSpeed
SetRunSpeed(speed: float) -> voidSets the player’s running movement speed.
player.SetRunSpeed(8.0)SetSilencedToTagged
SetSilencedToTagged(level: int, tagName: string, tagValue: string) -> voidSetSilencedToUntagged
SetSilencedToUntagged(level: int, tagName: string, tagValue: string) -> voidSetStrafeSpeed
SetStrafeSpeed(speed: float) -> voidSetVelocity
SetVelocity(velocity: Vector3) -> voidSets the player’s movement velocity. Useful for launch pads and boost zones.
player.SetVelocity(Vector3.up * 10.0)SetVoiceDistanceFar
SetVoiceDistanceFar(far: float) -> voidSetVoiceDistanceNear
SetVoiceDistanceNear(near: float) -> voidSetVoiceGain
SetVoiceGain(gain: float) -> voidSetVoiceLowpass
SetVoiceLowpass(enabled: bool) -> voidSetVoiceVolumetricRadius
SetVoiceVolumetricRadius(radius: float) -> voidSetWalkSpeed
SetWalkSpeed(speed: float) -> voidSets the player’s walking movement speed.
player.SetWalkSpeed(2.0)TeleportTo
TeleportTo(teleportPos: Vector3, teleportRot: Quaternion, teleportOrientation: VRCSDKBaseVRC_SceneDescriptorSpawnOrientation, lerpOnRemote: bool) -> voidTeleportTo(teleportPos: Vector3, teleportRot: Quaternion, teleportOrientation: VRCSDKBaseVRC_SceneDescriptorSpawnOrientation) -> voidTeleportTo(teleportPos: Vector3, teleportRot: Quaternion) -> voidTeleports the player to a position and rotation. Only works on the local player.
player.TeleportTo(spawnPos, spawnRot)ToString
ToString() -> stringUseAttachedStation
UseAttachedStation() -> voidUseLegacyLocomotion
UseLegacyLocomotion() -> void