From the course: Unity 5: Network Gaming

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Multiplayer health

Multiplayer health - Unity Tutorial

From the course: Unity 5: Network Gaming

Start my 1-month free trial

Multiplayer health

- [Instructor] During the introductory chapter of this course we talked about server versus client authority. Working with health is pretty much always appropriately done with the server authority methodology. Right now each client is responsible for reporting its own health status to the user. Our next step is to modify our code so that the server tracks each player's health and, as such, the server is the authority on the current health state of each player. Since server versus client authority is an important concept I want to drive this point home. There are things that are fine as client authority, for example, the position of a fired projectile. We can instantiate it at the server level but once instantiated, letting the local clients perform the computations to move the projectile individually on each client is fine. The server doesn't need to be notified until the projectile hits something at which stage it should be reflected in the tank object, not the projectile. If the…

Contents