adding a new player into a 2d game in unity3 using a player prefab?

Im creating a 2d game, something like 1942 and I want to add a new plane into the game by scripting. I have a player prefab that I add by scripting, but if I add another player prefab it has the same controls that player 1.

I know that making a different player2 Prefab should do the trick but I want to know if I can use the same prefab that player1.

please help! :D

There's not much of a question here...

The reason both players would have the same controls is presumably because you have the script that controls the players attached to... well... both players.

There are many ways to specify a different control scheme for the second player.

  • You could specify variables that control what keys are used for input and alter them when the prefab is instantiated
  • You could create a "Player2" tag and tag the prefab after you've instatiated it. Then you could check the tag in your control script and look for input from the relevant keys

I'm sure there are more ways but these two are the most obvious ones...