ParelVRDocs
Player site

Scripting / Reference

Objects

Types in the ParelVR.Volt.Objects namespace.

VoltCollider#

ParelVR.Volt.Objects.VoltCollider reference extends VoltComponent

A collider of any shape.

VoltCollider properties#

Vector3 BoundsCenter { get; }

Centre of the collider's bounding box in world space.

Vector3 BoundsSize { get; }

Size of the collider's bounding box in world space.

bool Enabled { get; set; }

Whether the collider takes part in physics.

bool IsTrigger { get; set; }

Whether the collider is a trigger: it reports overlaps instead of blocking.

VoltRigidbody Rigidbody { get; }

The rigidbody the collider belongs to, if any.

VoltCollider methods#

Vector3 ClosestPoint(Vector3 position)

The point on the collider closest to a position.

VoltComponent#

ParelVR.Volt.Objects.VoltComponent reference extends VoltObject

Base of the references to components.

VoltComponent properties#

VoltGameObject GameObject { get; }

The object the component is on.

VoltTransform Transform { get; }

The transform of the object the component is on.

VoltComponent methods#

T GetComponent()

Finds another component, or a behaviour, on the same object.

VoltForceMode#

ParelVR.Volt.Objects.VoltForceMode enum

How a force is applied to a rigidbody.

Value Meaning
Force (0) A continuous force that takes mass into account.
Impulse (1) An instant push that takes mass into account.
VelocityChange (2) An instant change of velocity that ignores mass.
Acceleration (5) A continuous acceleration that ignores mass.

VoltGameObject#

ParelVR.Volt.Objects.VoltGameObject reference extends VoltObject

An object in the world scene.

VoltGameObject properties#

bool ActiveInHierarchy { get; }

Whether the object and all of its parents are switched on.

bool ActiveSelf { get; }

Whether the object itself is switched on.

int Layer { get; set; }

The layer the object is on, 0 to 31.

VoltObjectReference Reference { get; }

The stable id of the object in this world, or 0 when it was created while the world was running.

string Tag { get; }

The object's tag.

VoltTransform Transform { get; }

The object's transform.

VoltGameObject methods#

bool CompareTag(string tag)

True when the object has the given tag.

T GetComponentInChildren()

Finds a component, or a behaviour, on this object or any of its children.

T GetComponentInParent()

Finds a component, or a behaviour, on this object or any of its parents.

T GetComponent()

Finds a component, or a behaviour, on this object. Returns null when there is none.

T[] GetComponentsInChildren()

Every component of a type on this object and its children.

void SetActive(bool active)

Switches the object on or off.

VoltLight#

ParelVR.Volt.Objects.VoltLight reference extends VoltComponent

A light.

VoltLight properties#

Color Color { get; set; }

Colour of the light.

bool Enabled { get; set; }

Whether the light is on.

float Intensity { get; set; }

Brightness of the light.

float Range { get; set; }

How far the light reaches, for point and spot lights.

float SpotAngle { get; set; }

Cone angle of a spot light in degrees.

VoltObject#

ParelVR.Volt.Objects.VoltObject reference

Base of the references a script can hold to things in the world scene. A reference only ever points at an object that belongs to the world; anything else reads as null.

VoltObject properties#

bool IsValid { get; }

False once the object has been destroyed.

string Name { get; }

The name of the object.

Operators and conversions: 1 available.

VoltObjectReference#

ParelVR.Volt.Objects.VoltObjectReference class

The stable id of a scene object. It is the same for every player and survives a rebuild of the world, so it is what to put in synced fields, network events and storage when a script needs to name an object.

VoltObjectReference properties#

string Id { get; }

The id as text. Empty for an object that was created while the world was running.

bool IsValid { get; }

True when the id names an object that exists in this world right now.

VoltObjectReference methods#

static VoltObjectReference FromId(string id)

Rebuilds a reference from the text of its id. Returns null when the text is not an id of this world.

VoltGameObject Resolve()

The object the id names, or null when it no longer exists.

VoltRenderer#

ParelVR.Volt.Objects.VoltRenderer reference extends VoltComponent

Something that draws: a mesh, a skinned mesh, a line, a trail.

VoltRenderer properties#

bool Enabled { get; set; }

Whether the renderer draws.

bool IsVisible { get; }

True while any camera can see the renderer.

int MaterialCount { get; }

Number of material slots.

VoltRenderer methods#

void ClearProperties()

Removes every property this script set, back to the material's own values.

Color GetColor(string property)

Reads a colour property.

float GetFloat(string property)

Reads a number property.

VoltTexture GetTexture(string property)

Reads a texture property: what this renderer was given, or the material's own texture. Null when there is none.

void SetBlendShapeWeight(int index, float weight)

Sets the weight of a blend shape on a skinned mesh, 0 to 100.

void SetColor(string property, Color color)

Sets a colour property of this renderer only, for example "_EmissionColor".

void SetColor(Color color)

Sets the main colour of this renderer only.

void SetFloat(string property, float value)

Sets a number property of this renderer only.

void SetTexture(VoltTexture texture)

Puts a texture into the main texture of this renderer only (_MainTex and _BaseMap).

void SetTexture(string property, VoltTexture texture)

Puts a texture into a texture property of this renderer only, for example "_MainTex", "_BaseMap" or "_EmissionMap": a render texture a camera draws into, or any texture of the world. Null gives the property back to the material.

void SetVector(string property, Vector4 value)

Sets a vector property of this renderer only.

VoltRigidbody#

ParelVR.Volt.Objects.VoltRigidbody reference extends VoltComponent

A physics body.

VoltRigidbody properties#

Vector3 AngularVelocity { get; set; }

Angular velocity in radians per second.

bool IsKinematic { get; set; }

A kinematic body is moved by scripts and animation only, not by forces.

float Mass { get; set; }

Mass in kilograms.

Vector3 Position { get; }

Position of the body in world space.

Quaternion Rotation { get; }

Rotation of the body in world space.

bool UseGravity { get; set; }

Whether gravity acts on the body.

Vector3 Velocity { get; set; }

Velocity in metres per second.

VoltRigidbody methods#

void AddForce(Vector3 force, VoltForceMode mode)

Pushes the body.

void AddForceAtPosition(Vector3 force, Vector3 position, VoltForceMode mode)

Pushes the body at a point, which also makes it spin.

void AddTorque(Vector3 torque, VoltForceMode mode)

Spins the body.

void MovePosition(Vector3 position)

Moves a kinematic body to a position, colliding along the way.

void MoveRotation(Quaternion rotation)

Turns a kinematic body to a rotation.

void Sleep()

Puts the body to sleep until something touches it.

void WakeUp()

Wakes the body up.

VoltSceneComponent#

ParelVR.Volt.Objects.VoltSceneComponent component

Base of the components ParelVR adds to Unity for worlds, such as VoltPickup and VoltStation. A script can hold one in a field and assign it in the inspector like any other component.

VoltSceneComponent properties#

bool enabled { get; set; }

Whether the component is switched on.

VoltGameObject gameObject { get; }

The object the component is on.

VoltTransform transform { get; }

The transform of the object the component is on.

VoltTransform#

ParelVR.Volt.Objects.VoltTransform reference extends VoltComponent

Position, rotation and scale of an object, and its place in the hierarchy.

VoltTransform properties#

int ChildCount { get; }

Number of direct children.

Vector3 EulerAngles { get; set; }

Rotation in world space as Euler angles in degrees.

Vector3 Forward { get; }

The blue axis of the object in world space.

Vector3 LocalEulerAngles { get; set; }

Rotation relative to the parent as Euler angles in degrees.

Vector3 LocalPosition { get; set; }

Position relative to the parent.

Quaternion LocalRotation { get; set; }

Rotation relative to the parent.

Vector3 LocalScale { get; set; }

Scale relative to the parent.

Vector3 LossyScale { get; }

Scale in world space. Read-only.

VoltTransform Parent { get; }

The parent transform, or null at the top of the hierarchy or when the parent is outside the world.

Vector3 Position { get; set; }

Position in world space.

Vector3 Right { get; }

The red axis of the object in world space.

Quaternion Rotation { get; set; }

Rotation in world space.

Vector3 Up { get; }

The green axis of the object in world space.

VoltTransform methods#

VoltTransform Find(string path)

Finds a child by name or by a path such as "Arm/Hand".

VoltTransform GetChild(int index)

The child at an index.

Vector3 InverseTransformDirection(Vector3 direction)

Converts a direction from world space to the object's space.

Vector3 InverseTransformPoint(Vector3 position)

Converts a position from world space to the object's space.

bool IsChildOf(VoltTransform parent)

True when this transform is somewhere below another one.

void LookAt(Vector3 worldPosition)

Turns the object so its forward axis points at a position.

void Rotate(Vector3 eulerAngles)

Turns the object by Euler angles in degrees, in its own space.

void RotateAround(Vector3 point, Vector3 axis, float angle)

Turns the object around an axis through a point in world space.

void SetParent(VoltTransform parent, bool keepWorldPosition)

Puts the object under another transform. Pass null to move it to the top of the world's hierarchy.

void SetPositionAndRotation(Vector3 position, Quaternion rotation)

Sets position and rotation in one call.

Vector3 TransformDirection(Vector3 direction)

Converts a direction from the object's space to world space.

Vector3 TransformPoint(Vector3 position)

Converts a position from the object's space to world space.

void Translate(Vector3 translation)

Moves the object by an offset in its own space.