Options
All
  • Public
  • Public/Protected
  • All
Menu

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 9).

    Returns number

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

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

setPosition

  • setPosition(position: Vector): void
  • Set the player's position. Doesn't do anything for VR players. DEPRECATED: Will be removed in a future version, use setPositionAndRotation instead.

    Parameters

    Returns void

setPositionAndRotation

  • setPositionAndRotation(position: Vector, rotation: Rotator): void
  • Set the player's position. Doesn't do anything for VR players. 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

setRotation

  • setRotation(rotation: Rotator): void
  • Set the player's rotation. Doesn't do anything for VR players. DEPRECATED: Will be removed in a future version, use setPositionAndRotation instead.

    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)

    Parameters

    • newSlot: number

    Returns boolean