Unity Photon Player Instantiation
I have a SteamVR Unity project which I'm converting to multiplayer. When another client joins the game, instead of two different players seeing each other, each player has it's own version of the game where he controls all fo the player instances. For example, while one player is connected everything is fine, but when a second player joins, the game just adds another Player prefab which the first player controls as well. I tried replacing the Player with a simple cube and everything seems fine. both the Player and the cube have Photon Transform View and Photon View scripts. I would appreciate any help I can get.
Answer by Captain_Pineapple · Mar 16, 2019 at 07:37 PM
Hey there and welcome to the forum :)
to instantiate another player prefab is normally the easiest thing to do. In your code you can check for photonView.IsMine
to check if the given gameobject is acually controlled by the local player. So encapsule your input code for player control in an if statement checking for this and you should be good to go. In case this does not solve your problem let me know and try to provide a bit more input on your setup.
Your answer
Follow this Question
Related Questions
Photon RPC 2 Answers
[SOLVED] PhotonNetwork.Instantiate cannot spawn players 0 Answers
Photon & Unity Question 0 Answers