title: How to use ClientRpc (or ServerRpc) in unity Netcode for GameObject?
body: <p>I'm having trouble understanding how to use those Rpc's correctly. Sometimes they work sometimes they don't.
  Example : I have this gameobject that is in the scene (not instantiated on connection), called &quot;Book&quot;, it has a script (&quot;SpellManager&quot;) so when both player connect, they both have this object in their scene.
  Now in that SpellManager script, I want my Host/Server to change a spell variable on collision. Let's say I have a &quot;string newSpell&quot; variable, how do I change this variable on the server side and then send the information to the clients ? I have tried something like this (simplified) :</p>
  <pre><code>    private string newSpell;
  
      private void OnTriggerEnter(Collider other)
      {
          if (NetworkManager.Singleton.IsServer)
          {
              newSpell = &quot;Earth&quot;;
              testClientRpc(Time.frameCount, newSpell);
          }
          else
          {
              print(&quot;OnClient &quot;);
          }
      }
      [ClientRpc]
      public void testClientRpc(int somenumber, string _newSpell)
      {
          newSpell = _newSpell;
      }
  </code></pre>
  <p>But this trows an error on the server : <code>NullReferenceException: Object reference not set to an instance of an object Unity.Netcode.NetworkBehaviour.get_NetworkManager () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.4/Runtime/Core/NetworkBehaviour.cs:219)</code>
  And it's coming from the <code>_newSpell</code> variable which is apparently null ? I even tried hardcoding newspell = &quot;Earth&quot; in the ClientRpc, same error. An example/video would be much appreciated, I couldn't find anything similar</p>