Recently connected players don't instantiate PhotonNetwork.Instantiate objects?
Is there a way to do this? I want players that recently joined a room to don't instantiate objects instantiated by PhotonNetwork, my players may be in different scenes so I don't always want these objects instantiated in all players.
Is it possible to do this?
Is it possible to do this?
0
Best Answer
-
http://forum.photonengine.com/discussion/9253/photonnetwork-instantiate-different-scenes
But I think I found a way around this.
Edit: Okay, seems like destroying objects left on another scene by the first players that joined the room is not prohibited and gives no errors so I created an enum with two values:
SceneType.Game
SceneType.Menu,
In the GameController class (that persists during the entire playing session) I declared:
public static SceneType currentSceneType;
This tells which scene type we are in and updates everytime a new scene loads.
Then, if a gameObject is spawned and has a class that checks this currentSceneType value in GameController, if we are in the wrong scene type for that game obejct we just destroy it.0
Answers
-
Up! Anyone?0
-
So I assume there is no way to do this?0
-
http://forum.photonengine.com/discussion/9253/photonnetwork-instantiate-different-scenes
But I think I found a way around this.
Edit: Okay, seems like destroying objects left on another scene by the first players that joined the room is not prohibited and gives no errors so I created an enum with two values:
SceneType.Game
SceneType.Menu,
In the GameController class (that persists during the entire playing session) I declared:
public static SceneType currentSceneType;
This tells which scene type we are in and updates everytime a new scene loads.
Then, if a gameObject is spawned and has a class that checks this currentSceneType value in GameController, if we are in the wrong scene type for that game obejct we just destroy it.0