Search Unity

NetworkServer.SpawnWithClientAuthority Not found

Discussion in 'Multiplayer' started by markpollard1, May 26, 2017.

  1. markpollard1

    markpollard1

    Joined:
    Apr 1, 2010
    Posts:
    70
    I am trying to run this code.


    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.Networking;
    6.  
    7.  
    8. public class PlayerInput : NetworkBehaviour {
    9. [Command]
    10.   void CmdSpawnThirdCamera()
    11.   {
    12.     var camSpawn = (Third_Camera)Instantiate(third_Camera);
    13.  
    14.     NetworkServer.SpawnWithClientAuthority(camSpawn, connectionToClient);
    15.   }
    16. }
    17.    

    But i get this message from unity ? any ideas

    `NetworkServer' does not contain a definition for `SpawnWithClientAuthority'
     
  2. markpollard1

    markpollard1

    Joined:
    Apr 1, 2010
    Posts:
    70
    Fixed it.. i was overriding the NetworkServer with my own script.