Photon instantiates all Network instantiated Objects again when other Players connect?

I am having some weird behaviour that past instantiated gameObjects (already destroyed) from other clients get also instantiated on the others when re- and connecting. This issue appears as long as the client that has called to “PhotonInstantiate” the prefabs is still on the server.

For example I have thrown a grenade in the editor client and it has exploded.

Then I run a second client (the built). When it connects to the server, this grenade gets also spawned only on this client again. Unfortunalty, because of the grenades last position before explosion on the editor was at the global spawnpoint, this player gets instant killed after joining the server.

The grenade is called by this code:

GameObject projectileClone = PhotonNetwork.Instantiate("Projectiles/" + projectile.name, bulletEmpty.position, transform.rotation, 0);

The prefab has an photonview component with its transform as observed component, set fixed, unreliable on change and position and rotation.

Don’t ever use PhotonNetwork.Instantiate for things such as projectiles, this is probably your problem. You need to use an RPC.

Here’s an example

public PhotonView pv;
public GameObject gren; // our grenade.
	void Update(){
		if (Input.GetKeyDown (KeyCode.G)) {
			pv.RPC ("ThrowGrenade", PhotonTargets.All);
		}
	}

	public void ThrowGrenade(){
		GameObject grenade = Instantiate (gren, transform.position,          Quaternion.identity) as GameObject;
	}

This way it creates the Grenades locally only to connected players.