Skip to content

Player bindings

SDraw edited this page Aug 15, 2023 · 6 revisions

Static properties

  • localPlayer: local player; get, Player
  • remotePlayers: all remote players; get, table
  • allPlayers: local and remote players; get, table

Properties

  • isLocal: local check; get, boolean
  • isRemote: remote check, boolean
  • isConnected: remote player validity, boolean
  • name: player name; get, string
  • uuid: player's UUID; get, string
  • position player position; get, Vector3
  • rotation: player rotation; get, Quaternion
  • avatarHeight: current avatar height; get, float
  • avatarScale: current avatar scale; get, float
  • playerHeight: current player height according to settings; get, float; for remote players avatarHeight is returned
  • playerScale: current player scale according to settings; get, float; for remote players avatarScale is returned
  • viewPosition: current camera view position; get, Vector3
  • viewRotation: current camera view rotation; get, Quaternion
  • inVR: VR state; get, boolean
  • inFBT: FBT presense state; get, boolean; always false for remote players
  • hasAvatar: current avatar presence; get, boolean
  • isAvatarLoading: avatar loading state; get, boolean; always false for remote players
  • isAvatarHumanoid: humanoid avatar check; get, boolean
  • isFlying: flying state; get, boolean
  • isCrouching: crouching state; get, boolean
  • isProning: proning state; get, boolean
  • isSitting: sitting state; get, boolean
  • isSprinting: sprinting state; get, boolean
  • isJumping: jumping state; get, boolean; always false for remote players
  • isGrounded: ground state; get, boolean
  • leftHandPosition: left hand VR controller position; get, Vector3
  • leftHandRotation: left hand VR controller rotation; get, Quaternion
  • rightHandPosition: right hand VR controller position; get, Vector3
  • rightHandRotation: right hand VR controller rotation; get, Quaternion
  • leftHandGesture: left hand gesture; get, float
  • rightHandGesture: right hand gesture; get, float
  • zoom: zoom state (middle mouse button); get, bool; always false for remote players
  • zoomFactor: zoom factor; get, float; always 0.0 for remote players
  • movementVector: movement direction of player; get, Vector2
  • lookVector: camera look change based on input; get, Vector2; always Vector2.zero for remote players
  • individualFingerTracking: fingers tracking state; get, boolean
  • fingerCurls: current finger curls; get, table with 10 float values
  • fingerSpreads: current finger spreads; get, table with 10 float values

Methods

  • bool Teleport(Vector3 pos, Quaternion rot = Quaternion.identity): teleports player to specific point, only for local player
  • bool SetImmobilized(bool immobilize): immobilizes player movement when immobilize is set to true, only for local player
  • bool Respawn(): respawns player, only for local player
  • Vector3 GetBonePosition(string humanBone): returns position of avatar bone, or Vector3.zero if avatar is generic, not loaded or doesn't have specific bone.
  • Quaternion GetBoneRotation(string humanBone): returns rotation of avatar bone, or Quaternion.identity if avatar is generic, not loaded or doesn't have specific bone.

Static methods

  • Player Find(string uuid): searches player by UUID
  • Player Find(GameObject object): searches player by provided GameObject

Utility functions

  • bool IsPlayer(object obj): checks if object is type of Player