Double spawning of players on new player joining


I was following this tutorial:

And made it to the end. However in my setup the players seem to spawn double when a new user connects.
I'm pretty confident that it has to do with the static variable on the PlayerManager, but I can't get my head around it.

Here is my project:

Could anyone point me in the right direction, what am I missing?

Thanks in advance!!



  • Hi,

    I did manage to solve it.
    Apparently, Photon was referring to the Kyle Robot prefab that was hidden in the Assets/Photon/Photonnetwork/.. folder and not my Assets/Resources one.
    I just renamed my Assets/Resources/KyleRobot and i got it to work. However I would like to understand better what went wrong here, if someone can explain that would be great because my GameManager was referencing the correct one.

  • Hi,

    yes, indeed, you can create many resources GameObjects in the same name and Unity will pick up the first one as it scans the Resources folder in your assets.

    It's not a ghost, it's the resources GameObject from the actual demo itself shipped with PUN.

    We need to put a warning in the tutorial mentioning this, or simply name it slightly different in the tutorial to avoid that.