From the course: Advanced Unity 2D: Platformer Player Movement
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Building multiple input managers for multi-player games - Unity Tutorial
From the course: Advanced Unity 2D: Platformer Player Movement
Building multiple input managers for multi-player games
- So now that we have our square wired up and we're able to map new keys onto it using its own input state and getting the values to those keys from our input manager interpreting Unity's own input manager, we're able to keep everything nice and clean in our code. To illustrate how this is all decoupled, we're actually gonna add a second player in and give it a try to remap the keys on the fly. In order to do this, let's duplicate the quad and move it over a little bit. Now, the quad's gonna have its own input state and its own simple movement script. And we don't need to change anything on here, it's still gonna be mapped to the right and the left key. What we want to do on the input manager, however, is copy the existing input manager and paste a new one as new. Now, we'll need to reference to the new quad for this input manager, so let's drag that over. You'll note that the first one is referenced to Quad and the second one is referenced to Quad 1. Now what we'll need to do is…
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
-
-
-
Input introduction5m 52s
-
(Locked)
Building an input manager5m 55s
-
(Locked)
Abstracting axis input5m 2s
-
(Locked)
Building an input state class4m 31s
-
(Locked)
Tracking button release states4m 7s
-
(Locked)
Reading from the input state class4m 39s
-
(Locked)
Building multiple input managers for multi-player games2m 52s
-
-
-
-
-
-
-
-
-
-
-
-