I need help in some tutorial !

Hii !
I followed quill18creates' tutorial about how to make multiplayer (This : https://www.youtube.com/watch?v=mLAilMkRxYU and this : https://www.youtube.com/watch?v=0h786_PmGDQ ) And I tryed it on some project and it worked perfect and beatiful . Now I currectly working on a new project and I founded this COOL fps kit :
https://www.youtube.com/watch?v=JnNWz53AMD0 and I think that this is the best kit . In quill's tutorial he is explaining how to make multiplayer game in UNITY'S CONTROLLER and the controller in the kit is CUSTOMED , wich was build by OMA (OneManArmy3d) and I tryed to active the scripts that he actives on the video, it works BUT I still controlling other player ! Why ? how to fix that ? Please I need your help ! Thank you !

Comments

  • You have to make sure that you disable the controllers on all players that are not the local player (and disable things like cameras, audio listeners etc). A simple way to do this is to disable the controllers on the prefab, then when the prefab is instantiated, check if its photonview is controlled by the local player. If it is, get the player components and enable them.

    So some sample code from a project I'm working on:
    [code2=csharp]GameObject player = PhotonNetwork.Instantiate("Player", spawnLoc, spawnRot, 0);
    PhotonView photonView = player.GetPhotonView();
    if(photonView.isMine){
    MouseLook look = player.GetComponent<MouseLook>();
    look.enabled = true;
    Camera camera = player.GetComponentInChildren<Camera>();
    camera.enabled = true;
    MouseLook[] cameraLook = player.GetComponentsInChildren<MouseLook>();
    for(int i = 0; i < cameraLook.Length; i++){
    cameraLook.enabled = true;
    }
    }[/code2]

    That isn't going to work copy pasted into your project so if you don't understand what's going on with the code let me know and I'll throw in some comments. The point though is that you need to handle the new controller you are using (the custom controller) and enable/disable those components when needed.
  • You have to make sure that you disable the controllers on all players that are not the local player (and disable things like cameras, audio listeners etc). A simple way to do this is to disable the controllers on the prefab, then when the prefab is instantiated, check if its photonview is controlled by the local player. If it is, get the player components and enable them.

    So some sample code from a project I'm working on:
    [code2=csharp]GameObject player = PhotonNetwork.Instantiate("Player", spawnLoc, spawnRot, 0);
    PhotonView photonView = player.GetPhotonView();
    if(photonView.isMine){
    MouseLook look = player.GetComponent<MouseLook>();
    look.enabled = true;
    Camera camera = player.GetComponentInChildren<Camera>();
    camera.enabled = true;
    MouseLook[] cameraLook = player.GetComponentsInChildren<MouseLook>();
    for(int i = 0; i < cameraLook.Length; i++){
    cameraLook.enabled = true;
    }
    }[/code2]

    That isn't going to work copy pasted into your project so if you don't understand what's going on with the code let me know and I'll throw in some comments. The point though is that you need to handle the new controller you are using (the custom controller) and enable/disable those components when needed.
    Yo !
    Thanks for your comment but this is not the awnser that I am looking for .

    I asked if you can help with the kit's controller so the multiplayer will work .
    I will be glad if you will .
    Thanks .