ParelVRDocs
Player site

Scripting / Reference

Players

Types in the ParelVR.Volt.Players namespace.

VoltBone#

ParelVR.Volt.Players.VoltBone enum

A bone of a player's avatar.

Values: Hips, Spine, Chest, Neck, Head, LeftShoulder, LeftUpperArm, LeftLowerArm, LeftHand, RightShoulder, RightUpperArm, RightLowerArm, RightHand, LeftUpperLeg, LeftLowerLeg, LeftFoot, LeftToes, RightUpperLeg, RightLowerLeg, RightFoot, RightToes

VoltFinger#

ParelVR.Volt.Players.VoltFinger enum

A player in the current instance. A script only ever sees what ParelVR chooses to share about a player: never an account, a session or anything that identifies the device.

Values: Thumb, Index, Middle, Ring, Little

VoltGesture#

ParelVR.Volt.Players.VoltGesture enum

A hand shape read from the fingers.

Value Meaning
None (0) No shape this list knows, or the fingers are not known.
Open (1)
Fist (2)
Point (3) Index finger out, the rest curled.
Victory (4) Index and middle fingers out.
ThumbsUp (5)
RockAndRoll (6) Index and little fingers out.
HandGun (7) Thumb and index finger out.

VoltPlayer#

ParelVR.Volt.Players.VoltPlayer class

VoltPlayer properties#

float AvatarEyeHeight { get; }

Height of the player's avatar in metres, from the floor to the eyes.

string AvatarId { get; }

Id of the avatar the player wears, or an empty string when it is not shared.

string DisplayName { get; }

The name the player shows to others.

int Fps { get; }

Frames per second the player's client is drawing, averaged over about a second. Zero until it is known.

float GravityStrength { get; set; }

Gravity on the local player as a multiple of normal gravity.

bool IsGrounded { get; }

True when the player is standing on something.

bool IsInVR { get; }

True when the player is in VR.

bool IsLocal { get; }

True for the player on this client.

bool IsMaster { get; }

True for the instance master.

bool IsSeated { get; }

True when the player is sitting in a station.

bool IsValid { get; }

False once the player has left the instance.

float JumpImpulse { get; set; }

Upward speed the local player gets from a jump. Zero disables jumping.

Vector3 NameplatePosition { get; }

Where a badge goes for this player: just above their nameplate, in world space.

int Ping { get; }

The player's round trip time to the instance server in milliseconds. Zero until it is known.

int PlayerId { get; }

Number of the player in this instance. Unique while the player is here; reused after they leave.

Vector3 Position { get; }

Where the player stands, in world space.

Quaternion Rotation { get; }

Which way the player's body faces.

float RunSpeed { get; set; }

Running speed of the local player in metres per second.

VoltStation Station { get; }

The station the player is sitting in, or null.

Vector3 Velocity { get; }

How fast the player is moving.

float WalkSpeed { get; set; }

Walking speed of the local player in metres per second.

VoltPlayer methods#

void ClearBadge()

Stops moving this player's badge; the object stays where it is.

float GetAvatarParameter(string name)

A parameter of the player's avatar, such as an expression toggle. Zero when the avatar has no such parameter.

Vector3 GetBonePosition(VoltBone bone)

Position of an avatar bone in world space. The player's position when the avatar has no such bone.

Quaternion GetBoneRotation(VoltBone bone)

Rotation of an avatar bone in world space.

float GetFingerCurl(VoltHand hand, VoltFinger finger)

How far a finger of the player's avatar is bent: 0 straight, 1 fully curled. Zero when it is not known.

VoltGesture GetGesture(VoltHand hand)

The hand shape the player is making, read from their avatar's fingers.

Vector3 GetPosition()

Position of the player in world space.

Quaternion GetRotation()

Rotation of the player's body in world space.

string GetTag(string key)

A tag the world's scripts gave this player, such as a team or a role. Empty when it has none. Tags are local to this client.

Vector3 GetTrackingPosition(VoltTrackingPoint point)

Position of a tracking point in world space. The player's position when the point is not available.

Quaternion GetTrackingRotation(VoltTrackingPoint point)

Rotation of a tracking point in world space.

Vector3 GetVelocity()

Velocity of the player in world space.

void Immobilize(bool immobile)

Stops the local player from walking. They can still look around and use the menu.

bool IsOwner(VoltGameObject target)

True when the player owns the object.

bool IsTrackingAvailable(VoltTrackingPoint point)

True when ParelVR has a position for a tracking point of this player.

void PlayHaptics(VoltTrackingPoint hand, float strength, float seconds)

Vibrates a controller of the local player. Does nothing on desktop.

void ResetVoice()

Puts this player's voice back to the local player's own settings.

void Respawn()

Moves the local player back to a spawn point.

bool SetAvatarParameter(string name, float value)

Changes a parameter of the local player's own avatar. False when it has no such parameter or it cannot be written.

void SetBadge(VoltGameObject badge)

Keeps an object of the world just above this player's nameplate, turned toward whoever is looking, until it is cleared, destroyed or the player leaves. One badge per player: a new one replaces the old. Only on this client; call it on every client (for example from OnPlayerJoined) so everyone sees it.

void SetTag(string key, string value)

Gives this player a tag on this client; an empty value removes it. Tags are cleared when the player leaves.

void SetVelocity(Vector3 velocity)

Sets the local player's velocity, for launch pads and knock-back.

void SetVoiceDistance(float metres)

How far away, in metres, the local player can still hear this player. Only changes what this client hears.

void SetVoiceGain(float gain)

How loud this player's voice is for the local player, 0 (muted) to 1 (normal). Only changes what this client hears.

void Teleport(Vector3 position, Quaternion rotation)

Moves the local player. Has no effect on another player.

VoltTrackingPoint#

ParelVR.Volt.Players.VoltTrackingPoint enum

A point on a player's body that ParelVR tracks or estimates.

Value Meaning
Head (0)
LeftHand (1)
RightHand (2)
Hip (3)
LeftFoot (4)
RightFoot (5)
Chest (6)
LeftShoulder (7)
RightShoulder (8)
LeftElbow (9)
RightElbow (10)
LeftKnee (11)
RightKnee (12)
Origin (13) The floor point under the player: where the avatar stands.