Photon Multiplayer Issues

I have setup a Photon Multiplayer script based off this tutorial: http://www.youtube.com/watch?v=2-1pofOjvmU

Problem is, when there are more than 1 player in the game, my side shows the other players, but they move in the same manner as I do, when I go right, they go right. But on their end, they may not be moving at all.

The only way I can think this is happening is because the script is instantiating the player, when ever some one else joins. Because the tank I am using is the same as tank I’m driving. Since both have the same movement script and they all are instantiated on my local machine, they move when I move.

Thing is, how can I fix this? Is it a flaw of Photon? Is there a better way to do this? Thanks!!!

There are a couple of ways you could do this. The simplest I could think of is disabling the movement script in your player prefab, then whenever you instantiate the object, check whether the local peer owns that object and enable it based on that.

I’m not well-versed in Photon, but I guess it goes something like:

OnPhotonInstantiateEvent:
if (PhotonView.isMine)
GetComponent.enabled = true;

What language is that in? C#? I am using Javascript.