Create a new "3D Core" Unity project
Import some XR Packages into your Unity project (Window / Package Manager):
"XR Interaction Toolkit" and its samples
it will import automatically "XR Core Utilities" and "XR Legacy Input Helpers"
"XR Plugin Management" and its samples
Import this package into your Unity project: RVC2023.unitypackage
Assets / Import Package / Custom Package...
It includes Photon2 and will allow joining an existing server
If you lose the photon server address, here it is: ff3bcfc7-ff4e-4689-8acc-7532edc10870
Give a new number version to your project:
To avoid conflicts between all your projects (it is not the best way do do that, but it can be enough for this practical work...)
Assets/Photon/PhotonUnityNetworking/Resources/PhotonServerSettings:
Settings : App Version
Add the two scenes from the "Resources/Networking" directory in the "Build Settings" (the launcher must be the first one):
Launcher.Unity
Arena
In the "Resolution and Presentation" section, change the "Fullscreen Mode" to "Windowed" with a 800x600 resolution:
in "Build Settings" / "Player Settings..." / "Resolution and Presentation"
Build the app, and run it at least twice for two different users:
You can also use only one build, and execute the second client directly in Unity
To make it possible to push the cubes...
There is a Rigid Body and Box Collider
In the "NavigationRig" prefab (declared in the "Assets/Resources" directory)
With a freeze of the position and orientation of the avatar
Try to push a cube with a player…
Do the cubes move for all the users?
In the same way?
Try to understand why...
Next, you will have to create a "SharedObject" prefab based on one of the cubes, to avoid to repeat manual changes to each of them
Drag the Cube1 object in the Assets/Ressources window and change its name
Replace the previous cubes by 3 instances of this new prefab
Change the colors of 2 of them to recreate the initial situation
Add networking attributes to the cubes
A PhotonTransformView
A PhotonView:
That will observe the PhotonTransformView
Observe option: Unreliable On Change
Try and see what happens:
Do the cubes move exactly in the same way for all the players?
Try to understand why!