Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Leaving and Rejoining a room problem

$
0
0
I also posted this on the Unity forums but i need an answer quick.

Just to let you know, I have a network manager with a photon view on it .

I'll explain what is happening visually:
Two people. 1 person on the unity editor, 1 person on a phone.
- Unity editor person hosts a match
- phone person joins and everything works fine, he leaves and then rejoins
- phone person on his side doesn't spawn
- unity editor person sees someone else spawn in the photon ID it says its not controlled locally but the name displayed came from the playerprefs of the unity editor person not the phone person, which means unity editor instantiated it.
-If phone person restarted the whole game and joins again it works fine. Spawns in normally like the very first instance of joining.

what is happening? Is having a photon view on the network manager and the player a problem?

This is what i do when i exit the room -

public void ExitToMenu(){
PhotonNetwork.LeaveRoom();
GameObject networkManager = GameObject.Find("NetworkManager");
Destroy(networkManager);
}

void OnLeftRoom(){
PhotonNetwork.LoadLevel("Menu");
}

I Destroy the network manager so that there are no duplicates when i re enter the other scene which already has one. I have dontdestroyonLoad on it so i have to get rid of it first.

I can post my network manger script if you want to look at the code.

thanks

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>