Trouble switching scenes with UCC and PUN

Somosky

Member
Hi I'm having a bit of a issue changing scenes with UCC and Pun.

So I spawn my characters in one scene and they work fine. However when I'm done with that scene I'm trying to switch the scene for all players.

It's a simple box trigger that can be entered. Upon entering it sends a message to the master client and sets scenes to sync async and load the next scene.

The scene loads properly for all players but only the master client has a player clone instantiated.

Has anyone seen anything like this? I can provide the warning and error messages if needed.
 
Also I have all the up to date assets. Pun, Pun UCC addon and UCC.

I was reading on the Pun forums that perhaps even though I am loading the scene synced through Pun that perhaps either the in editor build or the built build is loading the scene before the other so the scene isn't instantiating the non master clone player prefab.
 
Hi Justin. I've created this short video to show you what I mean. I was incorrect stating that there were any errors.


For some reason the YouTube video is showing as not available at least for me when I post it here. So if you search on YouTube

Issues with Opsive UCC and PUN2 Integration

It's like the third one down and my channel name is TeamLiveBadass

Or just copy this to your web browser
youtu.be/oDzyFVxU2-0
 
Last edited:
I would ask this on the PUN forums to see if they have any idea. From the character controllers standpoint it doesn't affect scene loading or unloading so as long as your scene has been loaded and the character has joined the room it will receive the correct callback.
 
Hi Justin the issue acutally was with the UCC Pun Addon. So it only checks when a player has joined a Room. But when switching scenes you are not joining a room. So the way I fixed this was going into the PUN "SpawnManagerBase" and adding this line of code in the Start Method after SpawnPlayer() is called.

foreach(Player i in PhotonNetwork.PlayerList)
{
if(i != PhotonNetwork.LocalPlayer)
{
SpawnPlayer(i);
}
}

I don't know if this will cause any other issues but it does fix the problem.
 
Top