Two players one room. When 1st joins he can move around fine, when 2nd joins they swap control. Why?

Options
When player one joins a room he can move about just fine however the problem begins when the 2nd player joins. At that moment player 2 controls the ship for player 1 and vice versa.

I thought the problem was due to the game objects sharing the same name on instantiation so I added a script to the player controller in the Start() method with something like gameObject.name = "SpaceShip("+PhotonNetwork.playerName+")"

This did not fix the problem and furthermore the name change worked fine for player 1, however for player 2 the gameObject was NOT given a new gameObject name. Its name remained "Spaceship (clone)." The fact that it did not change for the 2nd player leads me to believe that somewhere in my code something is out of sync when the 2nd player loads...duh right?

Since I'm totally new to PUN I don't know where to begin to troubleshoot which led me to the community of PUN devs on this forum.

Any help you can provide might put me on the right track to solving this, thank you in advance. Let me know what kind of additional info you need.

Comments

  • Hi @Sfoxx28,

    I'm not sure but I think that you have also sent us an email about the same problem, am I right? If so, support continues via email. If not, please let me know in order to try to answer your question here.