Wrong character being controlled

I downloaded photon a few days ago and I'm impressed as to how good it is. The demos work perfectly but sadly I'd like to move on from vikings and I'm having a few difficulties.

I'm using the default unity first-person controller scripts (converted to c#) on a capsule with MainMenuVik and GameManagerVik attached to an empty gameObject. My capsule also has as Photon View attached.

To try and make the keyboard/mouse only control the right character, I've added
if (!pv.isMine) return;
to the very start of all the relevant movement methods, where pv is the PhotonView.

This is all working fine in the editor and stand-alone exe with only one character, however when another exe is opened the keyboard/mouse instantly start controlling the wrong character only; the exe which has focus is completely frozen and the one which is running in the background (title bar greyed out etc) is moving correctly, albeit incredibly laggy where there was none before. I have no idea what to do, since usually when there's a problem everything just goes completely all over the place and this time it's manageable (other than lag) but just controlling the wrong person!

Does anyone have any idea why this is happening? I'll post any code if necessary but the only change from the default scripts are the added line mentioned above.


  • Did you work through the Marco Polo Tutorial?
    http://doc.exitgames.com/en/pun/current ... marco-polo

    I am not sure if I can help here, aside from pointing you to that tutorial.
    If the other client is moving your character, it seems you do send the movement but don't apply it locally.
    I fear you will have to debug this more or less by yourself.
  • I have, yes, and I can get it working using those assets/scripts but I'd like to use my own. I'll just start again from scratch and hopefully it'll work.
Sign In or Register to comment.