Spawning 2 players when the game starts

Well, i’m making an FPS and i tried to make a switch weapons system, but i tried to do it with no tutorials, making the code myself, but i’m not good at coding and i’m not expert in unity, so everything went wrong. Then i deleted every change I made, but now when I start the scene, 2 players spawn, the one that is already in the game, and another that falls from the sky. In game I can see the clone’s camera (the one that falls from the sky) but when I shoot the bullets come from the other one. Also walking and moving the camera affect both players, and my AI Enemies attack the original one, and also when they get to close, i can hear 2 bg musics instead of one (cuz the Audio Source is attatched to the Main Camera), how can I fix this? And if there’s no fix, there’s any way I can…count the amount of players (and if there are more than 1 the rest is deleted) or delete all the clones with the tag “Player” (without deleting the original one)?

Please help, i apologize about my english, and the game is single player, so there’s no respawn or multi player system

Instead of trying to delete the clone you should be looking for where the clone is created. I am guessing it gets spawned in run time so look at the code you wrote to spawn the player and you may find a bug in there. If you cant find it post the source code and maybe one of us can find it.

Could you please post screen shot of your editor so we can see may be whats wrong.

Regarding Two player spawning.

  1. Drag and drop the player which is in ‘Hierarchy’ to ‘Project’ tab.
  2. Delete the one is Hierarchy.
  3. drag and drop player from ‘Project’ ( it is a prefab now ) To your script.