-
Notifications
You must be signed in to change notification settings - Fork 5
Physics
As Unity's physic engine is not deterministic, we have to sync the resulting transformation of rigid body objects in every frame.
Add a NetworkIdentity component to every game object whose transformation should be synchronized (The game object must also have a rigid body component!). This will synchronize the local position, rotation an scale of the object across all nodes (only if one of them changed).
Be careful: Do not sync too many objects (>300) as their transformations are synced every frame they change.
If you want to sync the transformation of dynamically created objects, you have spawn them using the NetworkServer.Spawn() method on master. Of course the used prefab must also have a NetworkIdentity component.
- every code you might want to run in a FixedUpdate() method: FixedUpdate is called by Unity's physic engine which is not synced!
At the beginning of every Update() call the master sends the transformation of all objects which have changed in the last Unity physics computation to all slaves.
| InputTransformationMessage |
|---|
| int transformLength |
| Transform[] transforms |
| Transform |
|---|
| uint networkId |
| Vector3 localPosition |
| Vector3 localEulerAngles |
| Vector3 localScale |
| Vector3 |
|---|
| float x |
| float y |
| float z |
General
Our Team
Quick start
The CAVE
Synchronization
Concept
Input
Time
Physics
Collision & Trigger
Particles
GUI
Animations
ConfigTool
Import Config-File
Add/remove Computers
Deploy/Update/Start project
Configuration
Deployment process
The Configuration-File
Projection
Interpupillary distance
Jenga VR in Unity
Sounds & Music
Game-Logic
Main Menu
Radial Menu
Flystick
Flystick Simulator
Info-Screen
Driving Simulation
Steering Wheel Integration
Source Collection
Stereoscopy
Unity Cluster Package
Networking