PlayerProxy

Description

API for accessing the player class.

Methods

Vector3 GetPosition()


Vector3 GetHeadPosition()

  • Description: Gets the head position of the player (effectively the camera position).

void SetPosition(Vector3 position)

  • Description: Useful for player teleportation.

void ApplyImpulse(Vector3 impulse)

  • Description: Applies velocity impulse to a player.

ushort GetOwnerClientId()


float GetHealth()


void SetHealth(float newHealth)

  • Description: Set health of the player. If more than current health the player is healed. If less than current health the player is damaged.

float GetMaxHP()

  • Description: Returns the max health of the player based on the current class.

bool IsAlive()


bool IsCrouching()


Vector3 GetViewDirection()

  • Description: Returns player's normalized view direction.

void SendMessage(string message)


PlayerTeam GetTeam()


Item Equip(string itemIdentifier)


void Unequip(string itemIdentifier)


bool IsEquippedInSlot(EquipSlot slot)


void PlaySfxEvent(LocalSfxEventType @type)

  • Description: Play sound effect on the client.

void IncrementScore(int value, bool sendReceivedPointsEvent, ReceivedPointsEventType receivedPointsEventType)


string GetClass(string identifier)


bool TryGetViewVoxels(float range, ViewVoxelsResult result)

  • Description: Gets the currently viewed voxels by player. This only checks against world, so will return viewed voxels even if any entity is blocking. Result parameter will be initialized when this function returns true.

string ToString()