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

Building multiple input managers for multi-player games - Unity Tutorial

From the course: Advanced Unity 2D: Platformer Player Movement

Start my 1-month free trial

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…

Contents