Adding multiplayer virtual reality
So far, we've learned about implementing multiplayer networking in Unity, but not specifically for VR. Now, we're ready for this. The way I've set things up, we do not need to change anything in our scene for it to work in VR.
Our avatar is just a head for a reason. In VR, the camera transform is controlled by the head pose from the HMD (Head-mounted Display) sensors. When the avatar is parented by the camera, it'll move in sync. While wearing the HMD, when you move your head and look around, the corresponding avatar in all the clients will move accordingly.
The Oculus Rift players
The scene presently has an instance of the standard FPSController
, which includes a Camera
component. We can use Unity 5's built-in ...
Get Unity Virtual Reality Projects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.