Sync infinite terrain between players?
So I have a world where "chunks" (flat cube prefabs) spawn all around the player. On these chunks, I have a random chance to spawn a rock or something. This is where the problem occurs. Player 1 sees a rock at point A, and player 2 sees a rock not at point A, but at point B. When I tried using photonNetwork.instantiate, this (since there's a world gen script on all players) would generate a rock at both point A and point B. Is there a way to fix this? Maybe have just one world generator script in the scene that generates terrain for both players?
Answers
-
PN.Instantiate won't work for this. It doesn't scale to this size.
To just have synced terrain, use a deterministic generator and sync the seed per chunk. We've got a basic Procedural Demo for this.
Keep in mind that PUN is in maintenance mode and we'd recommend Fusion anytime you work with a lot of objects and could use effective synchronization of values.
1 -
Thanks again Tobias!
0