Destroyed Instances appear in clients that join game late

Options
I have instantiated enemies from the master client using both PhotonNetwork.Instantiate and PhotonNetwork.InstantiateSceneObject. These were called in OnJoinedRoom()

[code2=csharp]if (PhotonNetwork.isMasterClient)
{

foreach (GameObject spawner in points)
{
eSpawnPoint = points[enemiesInRoom];

PhotonNetwork.InstantiateSceneObject("Enemy", eSpawnPoint.transform.position, Quaternion.identity, 0, objs);
enemiesInRoom++;
}
}[/code2]

The enemies have an RPC "void Die()". When called, it destroys the enemy on all clients currently in the game. I'm destroying them using [code2=csharp]PhotonNetwork.Destroy(this.gameObject)[/code2] (i've used the this.photonview overload as well).

However, when a new person joins the room, the instances appear at their spawn point, despite being destroyed across the room.
Why would this be happening? How can I destroy any instances that appear this way as a safeguard?

Comments

  • Tobias
    Options
    I assume you made sure PhotonNetwork.Destroy() is actually called.
    If you do, the GO's should also be removed from the server's memory of instantiates, of course.

    Does this happen every time or only when the new player joins while something is being destroyed?
    Which PUN version are you using? The latest from the Asset Store?