Obviously working with PUN here. I’m creating a game based on the Marco Polo tutorial. I’m running one instance of the game on Computer 1 (my main machine), and I’m running another (build) instance on Computer 2 (the laptop sitting next to my main machine). (I’m running the other instance on a separate machine just to make sure that two instances on the same machine was not causing the problem I’m about to describe.)
I start one instance on Computer 1, go through the lobby, create the room, and join the room. My player prefab spawns at a random spot within a certain zone.
I start the second instance on Computer 2, join that game, and this new prefab should also spawn at a random place within the same zone, but instead, it immediately switches places with the spawned player on Computer. And the player on Computer 1 goes somewhere else (I assume where the Computer 2 prefab would have spawned, if it was working right).
The spawning code is pretty standard:
Vector3 spawnPosition = new Vector3(Random.Range(-10.0F, 10.0F), 0f, Random.Range(-10.0F, 10.0F)); PhotonNetwork.Instantiate(this.playerPrefab.name, spawnPosition, Quaternion.identity, 0);
Any thoughts why this might happen? Thanks.