Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Player

A player in the game

Hierarchy

  • Player

Index

Methods

getCursorPosition

getCursorVelocity

getHandCards

  • getHandCards(): Card[]
  • Get the card holder that represents the hand of the player

    Returns Card[]

getHandHolder

getHeldObjects

getHighlightedObject

getName

  • getName(): string

getPlayerColor

  • getPlayerColor(): Color

getPosition

getPrimaryColor

  • getPrimaryColor(): Color

getRotation

getSecondaryColor

  • getSecondaryColor(): Color

getSelectedObjects

getSlot

  • getSlot(): number
  • Return the player slot of this player (a number from 0 to 17). The slot determines the color of the player and what objects they own.

    Returns number

isBlindfolded

  • isBlindfolded(): boolean
  • Return whether this player is currently blindfolded

    Returns boolean

isHolding

  • isHolding(): boolean
  • Return whether the player is currently holding objects

    Returns boolean

isHoldingObject

  • Return whether the player is currently holding the specified object

    Parameters

    Returns boolean

isHost

  • isHost(): boolean
  • Return whether this player is the host of the current game

    Returns boolean

isScriptKeyDown

  • isScriptKeyDown(index: number): boolean
  • Return whether a script action key is held by the player

    Parameters

    • index: number

    Returns boolean

isValid

  • isValid(): boolean
  • Return whether the player is valid. A player becomes invalid when it drops out from the game

    Returns boolean

sendChatMessage

  • sendChatMessage(message: string, color: Color): void
  • Send a message to the player's chat

    Parameters

    • message: string
    • color: Color

    Returns void

setBlindfolded

  • setBlindfolded(on: boolean): void
  • Set whether this player is blindfolded

    Parameters

    • on: boolean

    Returns void

setHandHolder

  • Set the card holder that represents the hand of the player. Can only be set to a holder that is owned by this player or a holder that has no owner.

    Parameters

    Returns void

setPositionAndRotation

  • setPositionAndRotation(position: Vector, rotation: Rotator): void
  • Set the player's position. After using for a VR player, won't do anything for that player for one second to prevent making players sick.

    Parameters

    Returns void

setPrimaryColor

  • setPrimaryColor(newColor: Color): void
  • Set the player's primary color

    Parameters

    Returns void

setSecondaryColor

  • setSecondaryColor(newColor: Color): void
  • Set the player's secondary color

    Parameters

    Returns void

showMessage

  • showMessage(message: string): void
  • Show a message on the player's screen

    Parameters

    • message: string

    Returns void

switchSlot

  • switchSlot(newSlot: number): boolean
  • Switch the player to a new slot. Returns whether the switch was successful (it fails if another player already occupies the chosen slot or if the slot number is invalid). Switching slots changes the player's color.

    Parameters

    • newSlot: number

      The new player slot, between 0 and 17

    Returns boolean