Home Unity

Unity Network Camera issues

Hi I was wondering if anybody could help I am currently working on my own game project and setting up a test multiplayer environment. So far I am able to create a new server and get a second player to join but when they do the camera and controls seem to lock to the last player to join it also looks like both players views are being rendered on top of each other.
What I assume I need to do is make sure each client has their own camera but doing this is being troublesome. I am not a coder and I am learning as I go along so any help would be appreciated.

thanks

Replies

  • Beelzeboss
    fixed this issue the solution was posted by Rodrigo G on the Unity forums put the script below on the camera if anyone finds themselves having the same issue basically turns off all cameras then turns on the player camera


    function FixedUpdate()
    {
    if (networkView.isMine)

    allCams = FindObjectsOfType(Camera);

    for (var cam : Camera in allCams) {

    cam.enabled = false;

    }

    var myCamO = this.gameObject;

    var myCam = myCamO.camera;

    myCam.enabled = true;
    }
Sign In or Register to comment.