title: Unity netcode: Instantiated object gets declared only on server side
body: <p>I currently have a few days to do with a problem in netcode. I instantiate an object in my script and spawn it into my ServerRpc function as a client. The problem then is that my object (&quot;instantiatedObj&quot;) is only declared on the server. So in the inspector you see as host that the client has this object declared but as a client you do not see that in the inspector. How could I solve the problem, i'm starting to pull my hair over it</p>
  <pre><code>public void SpawnObject() //SpawnObject gets executed when new player enter game
  {
      if (IsOwner)
      {
          if (NetworkManager.Singleton.IsServer)
          {
              GameObject go = (GameObject)Instantiate(objTOInst, new Vector3(0.7110749f, 0.32f, -0.09f), transform.rotation);
              go.GetComponent&lt;NetworkObject&gt;().Spawn();
              instantiatedObj = go;
          }
          else 
          {
              SpawnOnServerRpc();
          }
      }
  }
  [ServerRpc]
  void SpawnOnServerRpc(ServerRpcParams rpcParams = default)
  {
      instantiatedObj = (GameObject)Instantiate(objTOInst, new Vector3(0.7110749f, 0.32f, -0.09f), transform.rotation);
      instantiatedObj.GetComponent&lt;NetworkObject&gt;().Spawn();     
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/onDRF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/onDRF.png" alt="enter image description here" /></a></p>