Scripting / Reference
Networking
Types in the ParelVR.Volt.Networking namespace.
VoltNetworkTarget#
ParelVR.Volt.Networking.VoltNetworkTarget enum
Who receives a network event.
| Value | Meaning |
|---|---|
All (0) |
Everyone in the instance, the sender included. |
Others (1) |
Everyone except the sender. |
Owner (2) |
The player who owns the object. |
Master (3) |
The instance master. |
Authority (4) |
The player with authority over the object: its owner, or the master when it has none. |
Local (5) |
Only this client; nothing is sent. |
VoltNetworking#
ParelVR.Volt.Networking.VoltNetworking static
The state of the connection to other players, and ownership of world objects.
VoltNetworking properties#
Beyond this distance in metres from every other player, synced objects and scripts send their state four times less often. 0, the default, turns it off.
True while the client is connected to the instance.
True when the local player is the instance master.
True once this client has received the current state of every synced object.
The player on this client.
The instance master.
Round trip time to the instance server in milliseconds.
A clock in milliseconds that is the same for every player in the instance. Use it to time shared events.
VoltNetworking methods#
The player who owns the object. The master for an object nobody has claimed.
True when the local player owns the object.
True when the player owns the object.
Gives the object to a player. Only its owner or the master can do this, and the owner can refuse a request.
VoltObjectPool#
ParelVR.Volt.Networking.VoltObjectPool component extends VoltSceneComponent
A fixed set of scene objects that the master turns on (spawns) and off (returns) for everyone. Late joiners see the same objects on. Add a VoltObjectSync to the objects to sync where they are too.
VoltObjectPool properties#
How many of them are spawned.
How many objects the pool has.
VoltObjectPool methods#
An object of the pool by position, spawned or not.
Turns an object of the pool off for everyone. Master only.
Turns on the first object that is off, for everyone, and returns it. Null when all are on. Master only.
VoltObjectSync#
ParelVR.Volt.Networking.VoltObjectSync component extends VoltSceneComponent
Keeps the position and rotation of an object the same for every player. The owner's copy decides; the others follow it smoothly. Add it to anything players can move: pickups, physics props, doors on hinges.
VoltObjectSync properties#
True when the local player owns the object.
The player whose copy of the object decides where it is.
VoltObjectSync methods#
Puts the object back where it was when the world loaded, for everyone. Owner only.
Turns gravity on or off for everyone. Owner only.
Makes the body kinematic or dynamic for everyone. Owner only.
Moves the object at once for everyone, without easing. Owner only.
