From the course: Unity 5: Network Gaming
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
The local player - Unity Tutorial
From the course: Unity 5: Network Gaming
The local player
- We've got our tanks running independently of each other, but we have a usability issue. With two tanks, it's not too bad, but if it were a dozen or more, all our tanks look exactly alike. It would be nice if we could identify our tank versus everyone else's. There are a lot of graphical treatments we could use here. Since we're focused on coding for this course, the simplest treatment would be just to change the color of our tank. We can do this in our Tank Controller Script. Find your tank in the Assets window. Find the Tank Controller Script and double-click it to open it in your Code Editor. I'm sure you're familiar with the start method that generally acts as the constructor in Unity scripts. It's right here on line 10. In an earlier video, we changed the class that it's inherits from, from MonoBehavior to NetworkBehavior. And as I mentioned, there are network corollaries to most of the common events that you're used to. And this is no exception. We're going to use a network…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Project overview3m 15s
-
(Locked)
Set up the Network Manager2m 11s
-
(Locked)
Network identity3m 1s
-
(Locked)
Testing the game3m 46s
-
(Locked)
Network transform6m 58s
-
(Locked)
The local player6m 26s
-
(Locked)
Instantiate projectiles6m 58s
-
(Locked)
Firing projectiles6m 5s
-
(Locked)
Multplayer projectiles5m 2s
-
(Locked)
Adding a health indicator, part 12m 53s
-
(Locked)
Adding a health indicator, part 23m 44s
-
(Locked)
Adding a health indicator, part 34m 46s
-
(Locked)
Multiplayer health5m 54s
-
(Locked)
Fragging the enemy5m
-
(Locked)
Respawning6m 14s
-
(Locked)
-