How to make my game local multiplayer?

I am making a game which I want to have local multiplayer. What I need to know is, how do I have the same character controller that uses the controls depending on whether it is Player 1 or Player 2. I don’t want Player 1 controlling both characters, for example.

You’ll need to have some variable in your controller script that tells it from what player it should take input. You’ll have to define different input buttons for each player in the input settings too. So you will get something like

public enum Player {Player1, Player2};

public Player myPlayer;

void Jump(){
 //Jump code or whatever
}

void Update(){

 if(myPlayer == Player.Player1){
  if(Input.GetButton("PlayerOneJump")) Jump();
  //all player 1 input handling here
 }
 if(myPlayer == Player.Player2){
 if(Input.GetButton("PlayerTwoJump")) Jump();
 //all player 2 input handling here
 }
}