Problems with player spawning

I have been trying to make a basic game the past few days in unity but I have hit a bit of a problem. The game is functioning and the basics are done but when I compile it the player does not appear but does function in Unity. The prefab itself works when I place it but using the code to place the player in the game does not. This is the code I am using to do it.

function Update () {
	if (player == "null" && playerLives >= 1 && start){
		playerLives --;
		Instantiate(playerShip, Vector3(0,-4.5,2), Quaternion.identity);
		player = GameObject.FindGameObjectWithTag("Player");
	}	
}

Taking out player == null allows the ship to spawn but then it ignores the lives system. What can I do to workaround this?

Seems to me you have 2 problems:

  1. if (player == "null" && playerLives >= 1 && start){... shouldn’t compile because you have “null” and not null. Try to take out the quotations.
  2. You might not be setting “start” as false, so every Update you instantiate a new player.