Building System
Options
Hi, i'm making a building system in PUN 2, what i doing is:
1- Spawn/Despawn buildings through server rpc (AllViaServer)
2- Regist or Unregist(in case that the build despawn) the building name in a list of strings that contains the current spawned buildings in the scene(AllViaServerBuffered)
The list is for spawn all the buildings in the scene when the player joins; The problem here is that i dont know how to syncronize the buildings list when the player join to the room
Any suggestions on how to fix that?
1- Spawn/Despawn buildings through server rpc (AllViaServer)
2- Regist or Unregist(in case that the build despawn) the building name in a list of strings that contains the current spawned buildings in the scene(AllViaServerBuffered)
The list is for spawn all the buildings in the scene when the player joins; The problem here is that i dont know how to syncronize the buildings list when the player join to the room
Any suggestions on how to fix that?
0
Comments
-
Interesting project.
I would recommend using PhotonNetwork.RaiseEvent() instead of RPCs. The RaiseEvent is used by RPCs but does not "target" a specific networked object via PhotonView (which does not contribute in this case).
I assume you are always just interested in the "state". Which buildings are built, etc?
Then you could also switch over to use properties.
Described here: https://doc.photonengine.com/en-US/pun/current/gameplay/synchronization-and-state/Instantiation/
This would give you the state on join.0