O'Reilly logo

Mastering Oculus Rift Development by Jack Donovan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Synchronizing data in multiplayer matches

Everything that you've done up to this point has been about getting players in the same match, but we haven't covered anything about keeping in-game events synced between the server and client. Fortunately, Unity's networking API makes this very easy; we can use most of the code we've already written with some slight modifications to make it network-aware.

Syncing player movement

The first thing we'll tackle is player movement, so you can see other people walking around the map. We'll build upon our existing player prefab and the NetworkIdentity component, as well as a new kind of component: NetworkTransform.

Select the ArenaPlayer prefab in your Project window and add a NetworkTransform component in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required