Hi,
This is my instantiation code for upgrade crates in each scene in my multiplayer game:
IEnumerator CrateDrop()
{
while (crateCount < 200)
{
xPos = Random.Range(50, 390);
zPos = Random.Range(50, 390);
//PhotonNetwork.Instantiate(crate.name, new Vector3(xPos, 26, zPos), Quaternion.identity);
PhotonNetwork.Instantiate(crate.name, new Vector3(xPos, 26, zPos), Quaternion.identity, 0);
yield return new WaitForSeconds(15);
crateCount += 1;
}
}
They spawn at random locations within the given range but If there is more then one player in the scene, the instantiation happens twice and I don’t know why this is happening.
I just need them to spawn one time, does anybody know why this happens?