1

I have a 2D game/demo I am working on for learning purposes for Unity Networking and I have come to a predicament on how I should handle multiple scenes in my game because as we all know most games have more than 2 scenes and players are not always in the same scene (someone is in the scene HouseLrg while the other is in MainWorld scene).

Now the best thing I have come across is :

SceneManager.LoadScene (newScene, LoadSceneMode.Additive)

But when I use this I notice that the scene that I am loading literally overlaps the scene I was currently on. So my questions are :

1) Is there something else besides LoadScene(string, LoadSceneMode.Additive) that would work for having players in different scenes?

2) If LoadScene(string, LoadSceneMode.Additive) is the solution I am looking for; would I have to just edit the position/location of my entire scene so it isn't in the same positions as other scenes so that when I load it "Additive" there is no overlap? Or is there something I can do that is "isLocalPlayer" based so that the player making the scene change is the only one that goes through it?

Help me become less ignorant please because, "Knowledge is Power!"

Thanks!

JoeyL
  • 1,295
  • 7
  • 28
  • 50
  • I don't know the answer. But in my opinion, if you have 2 scenes and a player on each scene, if the network manager is not destroyed on load, they should still be both connected to the server but won't see each other action? – Itération 122442 Feb 24 '17 at 21:03
  • @Andromelus I worked off the demo from the Unity tutorial but made it 2D instead of 3D as I am working in 2D atm. All I added to that demo is a GameObject which when collided with changes the scene. I tried it both ways (normally then I tried using Additive) and the results were not what I was looking for. What I noticed was that the player colliding with the GO that changes the scene will see both scenes while on my other client running has everything the same (so far so good) but I still see the player that is moving around which I shouldn't as it should be in another scene. – JoeyL Feb 24 '17 at 21:51
  • According to the doc', load additive does not destory GO but instantiate GO from the loaded scene on the current scene. But do you really want it? I mean, do you want 2 independent scenes (with networking, then (I THINK) players won't be able to see each other action because there are on different scenes) you should not destroy the network manager (DontDestroyOnLoad))? – Itération 122442 Feb 24 '17 at 22:09
  • @Andromelus Yea I read the docs but still having issues. I never did destroy the Network Manager but my main goal is to not just have 1 scene running as I can have a house that you can walk in which is another scene and the outside of the house which is another scene which there could be a player outside and a player inside. How would I approach a solution to get that working? My guess is LoadSceneMode.Additive but I am so ignorant on this topic I really need help. – JoeyL Feb 28 '17 at 22:43

0 Answers0