Remote Player deactivated On Joined Room

Vlaxep

Active member
Hi,

I'm occasionally but not in all cases, getting a circumstance where a player will join a PUN room and usually the host - but sometimes not visible to other players too! - cannot see RemotePlayerCharactersPrefabs when the new players become instantiated. I also have massive issues from the other perspective where players are not seeing the updated position or appearance of players that have moved or changed appearance since their own instantiation occurred.

(Players can join the room at any time dropin-dropout, the Scene Itself it firstly loaded by the Master at the same time the room is created, so the scene acts like a physical room lobby or sorts.)

I've noticed this in editor as the NewJoinedPlayerPrefab pops in but is deactivated, so I can usually only check this from one of the players at a time in editor.

Also found in the SpawnManagerBase this section of code from around line 145ish where the newPlayer object is deactivated after instantiation with a note:

// Deactivate the character until the remote machine has the chance to create it. This will prevent the character from
// being active on the Master Client without being able to be controlled.


I'm wondering first of all how should I manage this issue?
Also despite that from the NewPlayer's perspective, he is now in the scene and has a functioning character though it isn't always visible to the master, sometimes to others as well - what is actually not occurring that causes this? I assume there is a function somewhere that must SetActive=true for these Playerobjects when there is a recognition that they have finally loaded their scene or joined the room or something?
 
Ah I think I know where I've gone wrong.
Trying to get my head around how a mid-game joiner is not getting the full picture. Generally anything that changes while players are already in the room causes no issues.

So normally Opsive SpawnManager calls the instantiation and destroy, and while I don't fully understand how it buffers these actions, I assume it keeps track and knows what to send a new player when they join?

I think the main problem for me occurs when:

PRIOR TO NEW PLAYER JOINING: A player using my StandardCharPrefab switches his skin/avatar which requires a large skeleton avatar, so he 'destroys' his prefab and 'instantiates' the BigCharPrefab (or vice versa) I have been calling these Destroys/Instantiates from a separate component to manage it myself, not realising I need to call from the Opsive script so it will (hopefully) keep track of this for the new player.

NEW PLAYER JOINS: Sees the last available info (from what I can gather) that Opsive SpawnManager could track. Generally this seems to be that it somehow registers BigInstantiate that the prior-existing playing character called in, but NewPlayer see it remaining in place where it originally instantiated. Hopefully if I can run everything via the SpawnManagerBase I can get things being tracked properly! I'm starting with a 'Spawn' button now to try to manage things in a more defined order!

1. I'd be grateful for info on exactly what I need to call in SpawnManagerBase and make sure occurs - to ensure that when my Players invoke a PrefabSwitch, that the NewInstantiatedPrefab is now known to Opsive scripts and will set this up correctly for a future incoming NewPlayer!

Cheers.

(P.S. I think the above issue of deactivated players is somehow related, but possibly due to invoking instantiations outside of SpawnManagerBase in the first place? Not sure)
 
Last edited:
Update just getting some assistance and looks like in circumventing the SpawnManagerBase, and instantiating a completely new Prefab, I'm creating an entirely new PhotonView and properties, and not updating all of the various values required which I assume PunAnimator, PunTransform and the like rely upon to sync characters for new and existing players!

I'm going to try extending my current code to update these in the SpawnManagerBase now, see how far I get haha
 
Top