Skip to content

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

PropertyTypeAccess
displayNamestringget
isInstanceOwnerboolget
isLocalboolget
isMasterboolget
isSuspendedboolget
playerIdintget

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.isInstanceOwner

isLocal

True if this player is the local user running this Udon script.

let local: bool = player.isLocal

isMaster

True if this player is the current instance master (first player or next after master leaves).

let master: bool = player.isMaster

playerId

The unique integer ID assigned to this player for the current instance.

let id: int = player.playerId

Methods

ClearPlayerTags

ClearPlayerTags() -> void

ClearSilence

ClearSilence() -> void

CombatGetCurrentHitpoints

CombatGetCurrentHitpoints() -> float

CombatGetDestructible

CombatGetDestructible() -> VRCSDKBaseIVRC_Destructible

CombatSetCurrentHitpoints

CombatSetCurrentHitpoints(hp: float) -> void

CombatSetDamageGraphic

CombatSetDamageGraphic(prefab: GameObject) -> void

CombatSetMaxHitpoints

CombatSetMaxHitpoints(maxHp: float) -> void

CombatSetRespawn

CombatSetRespawn(respawnOnDeath: bool, respawnTimer: float, respawnLocation: Transform) -> void

CombatSetup

CombatSetup() -> void

EnablePickups

EnablePickups(enable: bool) -> void

Enables or disables the player’s ability to pick up VRC_Pickup objects.

player.EnablePickups(false)

Equals

Equals(obj: object) -> bool

FindComponentInPlayerObjects

FindComponentInPlayerObjects(referenceComponent: UnityEngineComponent) -> UnityEngineComponent

GetAvailableLanguages

static GetAvailableLanguages() -> string[]

GetAvatarEyeHeightAsMeters

GetAvatarEyeHeightAsMeters() -> float

GetAvatarEyeHeightMaximumAsMeters

GetAvatarEyeHeightMaximumAsMeters() -> float

GetAvatarEyeHeightMinimumAsMeters

GetAvatarEyeHeightMinimumAsMeters() -> float

GetBonePosition

GetBonePosition(tt: UnityEngineHumanBodyBones) -> Vector3

Returns the world position of a specific avatar bone (e.g., head, hand).

let headPos: Vector3 = player.GetBonePosition(HumanBodyBones.Head)

GetBoneRotation

GetBoneRotation(tt: UnityEngineHumanBodyBones) -> Quaternion

Returns the world rotation of a specific avatar bone.

let handRot: Quaternion = player.GetBoneRotation(HumanBodyBones.RightHand)

GetCurrentLanguage

static GetCurrentLanguage() -> string

GetDrone

GetDrone() -> VRCSDKBaseVRCDroneApi

GetGravityStrength

GetGravityStrength() -> float

GetHashCode

GetHashCode() -> int

GetJumpImpulse

GetJumpImpulse() -> float

GetManualAvatarScalingAllowed

GetManualAvatarScalingAllowed() -> bool

GetPickupInHand

GetPickupInHand(hand: VRCSDKBaseVRC_PickupPickupHand) -> VRCSDKBaseVRC_Pickup

GetPlayerById

static GetPlayerById(playerId: int) -> Player

GetPlayerCount

static GetPlayerCount() -> int

GetPlayerId

static GetPlayerId(player: Player) -> int

GetPlayerObjects

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) -> string

GetPosition

GetPosition() -> Vector3

Returns the player’s current world-space position.

let pos: Vector3 = player.GetPosition()

GetRotation

GetRotation() -> Quaternion

Returns the player’s current world-space rotation.

let rot: Quaternion = player.GetRotation()

GetRunSpeed

GetRunSpeed() -> float

GetStrafeSpeed

GetStrafeSpeed() -> float

GetTrackingData

GetTrackingData(tt: VRCSDKBaseVRCPlayerApiTrackingDataType) -> VRCSDKBaseVRCPlayerApiTrackingData

GetType

GetType() -> SystemType

GetVelocity

GetVelocity() -> Vector3

GetVoiceDistanceFar

GetVoiceDistanceFar() -> float

GetVoiceDistanceNear

GetVoiceDistanceNear() -> float

GetVoiceGain

GetVoiceGain() -> float

GetVoiceLowpass

GetVoiceLowpass() -> bool

GetVoiceVolumetricRadius

GetVoiceVolumetricRadius() -> float

GetWalkSpeed

GetWalkSpeed() -> float

Immobilize

Immobilize(immobile: bool) -> void

Prevents or allows the local player from moving. Pass true to freeze, false to unfreeze.

player.Immobilize(true)

IsOwner

IsOwner(obj: GameObject) -> bool

IsPlayerGrounded

IsPlayerGrounded() -> bool

Returns true if the player is currently standing on a surface.

let grounded: bool = player.IsPlayerGrounded()

IsUserInVR

IsUserInVR() -> bool

Returns true if the player is using a VR headset (false for desktop users).

let vr: bool = player.IsUserInVR()

IsValid

IsValid() -> bool

PlayHapticEventInHand

PlayHapticEventInHand(hand: VRCSDKBaseVRC_PickupPickupHand, duration: float, amplitude: float, frequency: float) -> void

Respawn

Respawn(spawnsIndex: int) -> void
Respawn() -> void

SetAvatarAudioCustomCurve

SetAvatarAudioCustomCurve(allow: bool) -> void

SetAvatarAudioFarRadius

SetAvatarAudioFarRadius(distance: float) -> void

SetAvatarAudioForceSpatial

SetAvatarAudioForceSpatial(force: bool) -> void

SetAvatarAudioGain

SetAvatarAudioGain(gain: float) -> void

SetAvatarAudioNearRadius

SetAvatarAudioNearRadius(distance: float) -> void

SetAvatarAudioVolumetricRadius

SetAvatarAudioVolumetricRadius(radius: float) -> void

SetAvatarEyeHeightByMeters

SetAvatarEyeHeightByMeters(scaleMeters: float) -> void

SetAvatarEyeHeightByMultiplier

SetAvatarEyeHeightByMultiplier(scaleMultiplier: float) -> void

SetAvatarEyeHeightMaximumByMeters

SetAvatarEyeHeightMaximumByMeters(scaleMeters: float) -> void

SetAvatarEyeHeightMinimumByMeters

SetAvatarEyeHeightMinimumByMeters(scaleMeters: float) -> void

SetGravityStrength

SetGravityStrength(strength: float) -> void

Sets the gravity multiplier for the player. 1 is normal, 0 is zero-gravity.

player.SetGravityStrength(0.5)

SetJumpImpulse

SetJumpImpulse(impulse: float) -> void

Sets the upward force applied when the player jumps.

player.SetJumpImpulse(5.0)

SetManualAvatarScalingAllowed

SetManualAvatarScalingAllowed(enabled: bool) -> void

SetPlayerTag

SetPlayerTag(tagName: string, tagValue: string) -> void

SetRunSpeed

SetRunSpeed(speed: float) -> void

Sets the player’s running movement speed.

player.SetRunSpeed(8.0)

SetSilencedToTagged

SetSilencedToTagged(level: int, tagName: string, tagValue: string) -> void

SetSilencedToUntagged

SetSilencedToUntagged(level: int, tagName: string, tagValue: string) -> void

SetStrafeSpeed

SetStrafeSpeed(speed: float) -> void

SetVelocity

SetVelocity(velocity: Vector3) -> void

Sets the player’s movement velocity. Useful for launch pads and boost zones.

player.SetVelocity(Vector3.up * 10.0)

SetVoiceDistanceFar

SetVoiceDistanceFar(far: float) -> void

SetVoiceDistanceNear

SetVoiceDistanceNear(near: float) -> void

SetVoiceGain

SetVoiceGain(gain: float) -> void

SetVoiceLowpass

SetVoiceLowpass(enabled: bool) -> void

SetVoiceVolumetricRadius

SetVoiceVolumetricRadius(radius: float) -> void

SetWalkSpeed

SetWalkSpeed(speed: float) -> void

Sets the player’s walking movement speed.

player.SetWalkSpeed(2.0)

TeleportTo

TeleportTo(teleportPos: Vector3, teleportRot: Quaternion, teleportOrientation: VRCSDKBaseVRC_SceneDescriptorSpawnOrientation, lerpOnRemote: bool) -> void
TeleportTo(teleportPos: Vector3, teleportRot: Quaternion, teleportOrientation: VRCSDKBaseVRC_SceneDescriptorSpawnOrientation) -> void
TeleportTo(teleportPos: Vector3, teleportRot: Quaternion) -> void

Teleports the player to a position and rotation. Only works on the local player.

player.TeleportTo(spawnPos, spawnRot)

ToString

ToString() -> string

UseAttachedStation

UseAttachedStation() -> void

UseLegacyLocomotion

UseLegacyLocomotion() -> void