-
Notifications
You must be signed in to change notification settings - Fork 5
Collisions
As we need to manually synchronize transformations of rigidbodies, we also need to synchronize collision and trigger events.
So instead of using the default Unity events like OnCollisionEnter, OnTriggerStay you have to use the corresponding synchronized methods. To get this work your script also needs to inherit from our CollisionSynchronization class instead of the Unity's MonoBehaviour.
| UnityEngine | CAVE |
|---|---|
| OnCollisionEnter(Collision collision) | OnSynchronizedCollisionEnter(GameObject other) |
| OnCollisionExit(Collision collision) | OnSynchronizedCollisionExit(GameObject other) |
| OnCollisionStay(Collision collision) | OnSynchronizedCollisionStay(GameObject other) |
| OnTriggerEnter(Collider other) | OnSynchronizedTriggerEnter(GameObject other) |
| OnTriggerExit(Collider other) | OnSynchronizedTriggerExit(GameObject other) |
| OnTriggerStay(Collider other) | OnSynchronizedTriggerStay(GameObject other) |
Synchronized collision and trigger events are only processed for game objects which own an initialized NetworkIdentity component!
- Synchronized events only offer the other game object as a parameter (Unity also delivers a little bit more information like collision time and point)
- Unity can pack multiple collisions which happen in the same cycle into one Collision object. As we do not support this, such events are split up into multiple synchronized collision events.
Collisions are synchronized by the general EventSynchronizer.

| InputEventsMessage |
|---|
| int eventsLength |
| Event[] events |
| Event |
|---|
| uint networkId |
| uint data |
| short type |
(type = OnCollisionEnter, OnCollisionExit, OnCollisionStay, OnTriggerEnter, OnTriggerExit, OnTriggerStay or OnClick)
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