I’m making a couch co-op game. This is my first time attempting multiplayer so this should be an easy question.
I’ve got a script called InputManager
. Inside of InputManager
are 2 public static classes: Player1
and Player2
. Inside of those classes are variables associated to the corresponding controller.
This game also contains vehicles. Each vehicle has a script that controls its movement and this is how they would access variables from the InputManager: InputManager.Player1.jump
or InputManager.Player2.jump
.
However my problem is, I only want to read the input from the player that is currently driving the vehicle, something like this: curPlayer.jump
How do I do this?