'Join on started room - Photon Unity

I wanted to "fake" persistant rooms. So I have a list of rooms with his names "room 1", "room 2", etc.

When the user clicks on one room I execute this:

PhotonNetwork.JoinOrCreateRoom(roomName, new RoomOptions({MaxPlayers = 16, BroadcastPropsChangeToAll = true}, TypedLobby.Default);

PhotonNetwork.LoadLevel("Game");

And when the user enters on game scene I instantiate his avatar:

GameObject myAvatar= PhotonNetwork.Instantiate(playerToSpawn.name, spawnPoint.position, Quaternion.identity);

The user enters on room without problem, the avatar is instantiated without problem... but, only the first user can move his avatar.

Before, new players could move "a bit" the first instantiated avatar (and this avatar instantly back to his original position) until I put the line:

if (view.IsMine){

Now just the first player can move the first avatar.

But I still have the problem that only the first user/avatar that enters on room can move around the world. It's like all inputs affect just this first avatar.

I hope you could help me. Greetings.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source