How does player movement and rotation work in PUN, and help with a problem.

Options
I am working on a game that is a multiplayer FPS game where multiple players (8) are placed in a map and they have teams. We were working on implementing PUN into the First Person Controllers (We made them, not the Unity premade ones) and we have come across a problem. The players connect, and all the controls work, except the input of one client controls the player of another client. I have no idea why this is happening. We used "if (PhotonView.isMIne)" to hold our movement controls. I have no idea why this is happening, please help!!!

Comments

  • Rigs
    Options
    You need to turn the correct transforms and classes off and turn them back on when you use photonview.ismine. when you spawn in to the room. unless you've done that? Just turn everything off and go from there.
  • Rigs said:

    You need to turn the correct transforms and classes off and turn them back on when you use photonview.ismine. when you spawn in to the room. unless you've done that? Just turn everything off and go from there.

    Im confused. Can you explain what classes and things you want me to turn off. And what exacly do you mean by "turn off". Sorry im very new to networking with PUN
  • Rigs
    Options
    the marco polo tuttorial is awesome and so is quil18creates on youtube.

    i'll post a snippet of how i activate certain things when i spawn, maybe it will help a bit.
    cam.SetActive(true);
    player.SetActive(true);
    firePoint.SetActive(true);
    rifle.SetActive(true);
    ((MonoBehaviour)player.GetComponent()).enabled = true;
    ((MonoBehaviour)player.GetComponent()).enabled = true;
    ((MonoBehaviour)player.GetComponentInChildren()).enabled = true;
    ((MonoBehaviour)player.GetComponent()).enabled = true;
    ((MonoBehaviour)player.GetComponent()).enabled = true;

    hope you can make sense of that. basically turn all your components off and scripts. that you want for the one player. save the prefab and then launch and when you spawn all the classes and transforms should be set to true, as you spawn.
    obviously yours will be a bit different but maybe you can get a rough idea.
    but, like a say the marco polo tutorial and demo is pretty awesome, so is quill18creates on YouTube.
    hope that helped pal
  • Rigs
    Rigs
    edited October 2015
    Options
    oh i forgot
    make sure your player networking class is active though

    PhotonView pv;

    void Start()
    pv = GetComponent();

    if(pv.isMine)
    {
    blah blah blah
    }

    i also have my:
    public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    stuff in side the same class.

    you can't put triangle brackets on the forum