Moving to new room/scene but not Sync

Options
Hi

PhotonCloud:
I currently have a room and scene "scene01" auto load on game start.

This is the main scene players walk around in.

I also have a portal to another scene "scene02".

I want players to be able to leave scene01 to go to scene02, but not take other players with them.

what I am trying is basically, once enter portal

- PhotonNetwork.automaticallySyncScene = false;
- Photon network leaveRoom() (to exit the room)
- Photon loadScene ("scene02")

However this still drags all other players along for the ride.

What is the correct way of preventing that ?

Cheers

-P



Comments

  • pjenness
    pjenness
    edited October 2016
    Options
    I

    Any ideas for this. Im stuck and its my next step,

    I need players to move to other scenes without syncing the rest of the players.
    Is there an example of this working, as all the google searchs I find seem to be for sync = true

    If also tried
    
    PhotonNetwork.automaticallySyncScene = false;
    PhotonNetwork.LeaveRoom ();
    then
    
    	public void OnLeftRoom ()
    	{
    
    
    		Debug.Log ("Left room now");
    		//PhotonNetwork.Disconnect ();
    
    		PhotonNetwork.LoadLevel (m_nextSceneName);
    
    	}
    I dont see how if left room and disconnected running LoadLevel effects other players still in that level.

    ...Actually Disconnect doesnt happen as at that point it is disconnecting , so have commented

    Very confused why all players follow still
    Even using
    SceneManager.LoadScene (m_nextSceneName);
    which should be outside of photon completely makes the player follow.


    Does it matter what game object these are on? I have one PUN manager in the scene that handles all this. Is that correct, or is it meant to be on the player game object that is the local? (I wouldnt have thought so)



    Cheers

    -P
  • jeanfabre
    Options
    Hi,

    The problem for you is that if you have PhotonNetwork.automaticallySyncScene = false, then you MUST NOT USE PhotonNetwork.LoadLevel (), BUT YOU MUST USE Application.LoadLevel, or the SceneManager api if you are in Unity 5.3+

    when PhotonNetwork.automaticallySyncScene = false, it's critical to understand that being in a Room isn't related to which scene is loaded, it's two totally different concepts. They are often coupled together, but it's just by convention, not by restriction nor design.

    when PhotonNetwork.automaticallySyncScene = true. It means that ONLY the Master can call PhotonNetwork.LoadLevel(), and every players in that room will get their scene loaded synchroniously. That's all. It still doesn't enfore a one to one relation between being in a Photon room and being in a Unity Scene.

    Does that make more sense?

    Bye,

    Jean
  • pjenness
    pjenness
    edited October 2016
    Options
    Hiya

    Yeah thats what I though too, and makes sense

    however even if I use
    SceneManager.LoadScene (m_nextSceneName);

    The other players also move to the same room. Which I dont under stand.
    Even if Ive used leaveRoom first..I would have thought that would separate the players communication, and then use Scenemanager.loadscene.

    Each scene have the PUN setup inside it to connect to that scene's room so works fine...its just all the players follow for some reason.


    Im using PUN free, and voice at the moment if that has any relation. Could it be another module is doing it.
    I actually started all my dev using the voice demo, so I wonder if there is anything in the voice setup that is getting called and keeping the photon connection in place.

    -P
  • pjenness
    Options

    Ah.
    It was working all along.

    My level portal was detecting any collider instead of just the local player. So when someone went thru the portal it triggered on everyones client as they saw a remot collider go thru the portal

    WOrking now

    Thanks!!

    -P
  • jeanfabre
    Options
    Hi,

    good! I am glad it works.

    Bye,

    Jean