Search Unity

disable other player when new player is initiated

Discussion in 'Multiplayer' started by JilJill, Feb 3, 2010.

  1. JilJill

    JilJill

    Joined:
    Nov 11, 2009
    Posts:
    132
    hi i am having problems developing my FPS network game.
    every time i initiate a new player into the game the camera keeps switching between both instances. i have disabled fpswalker and mouselook but i can't get rid of this problem. if any one can help it will be much appreciated. heres my script
    Code (csharp):
    1.  
    2.  
    3. function OnNetworkInstantiate (msg : NetworkMessageInfo) {
    4.     // This is our own player
    5.     if (networkView.isMine)
    6.     {
    7. //      Camera.main.SendMessage("SetTarget", transform);
    8.         GetComponent("NetworkInterpolatedTransform").enabled = false;
    9.         Debug.Log("a");
    10.     }
    11.     // This is just some remote controlled player
    12.     else
    13.     {
    14.     Debug.Log("b");
    15.         name += "Remote";
    16.         GetComponent(FPSWalker).enabled = false;
    17.         GetComponent(MouseLook).enabled = false;
    18.         //GetComponent(ThirdPersonController).enabled = false;
    19.         //GetComponent(ThirdPersonSimpleAnimation).enabled = false;
    20.         GetComponent("NetworkInterpolatedTransform").enabled = true;
    21.     }
    22. }
    23.  
    [/code]
     
  2. DrHotbunz

    DrHotbunz

    Joined:
    Feb 14, 2009
    Posts:
    315
    You still have this ?
     
  3. DrHotbunz

    DrHotbunz

    Joined:
    Feb 14, 2009
    Posts:
    315
    Ill take that as a No.
     
  4. JilJill

    JilJill

    Joined:
    Nov 11, 2009
    Posts:
    132
    yes i do
     
  5. DrHotbunz

    DrHotbunz

    Joined:
    Feb 14, 2009
    Posts:
    315
    In your inspector is the check box on the cameras toggling on and off ?
     
  6. JilJill

    JilJill

    Joined:
    Nov 11, 2009
    Posts:
    132
    no its not