My PhotonView Is Controlling All Charcters In The Game Please Help

Options
hi I'm Trying To Make A PUN Game With Unity And My PhotonView Is Controlling All Charcters In The Game And I Can't Get It To Work Currently I Have Looked At The Demos I Use Unity 5!

Comments

  • You have to verify who the owner of the characters is. It seems to me that you had one player instantiate all the characters and didn't deal with their ownership, but I would need more info on what you've done. Or in the movement code you don't check if the photonView is yours before doing any actions.
  • You have to verify who the owner of the characters is. It seems to me that you had one player instantiate all the characters and didn't deal with their ownership, but I would need more info on what you've done. Or in the movement code you don't check if the photonView is yours before doing any actions.

    How To I Check If The Photon View Is Mine?

  • You'd usually put the if condition at the start like so (keep in mind your script class would have to inherit Photon.MonoBehaviour for the way I'm mentioning):

    if (photonView.isMine) {}
  • You'd usually put the if condition at the start like so (keep in mind your script class would have to inherit Photon.MonoBehaviour for the way I'm mentioning):

    if (photonView.isMine) {}

    Ok... Can I See Your Script? I'm Confused
  • Well, I mean there are scripts containing this example if the Demo projects, but here's a more elaborate example:

    void Update () { if (photonView.isMine) { // Do movement code here } }
  • benjamin7006
    Options
    Ok Thanks :)