ClientRPC breaks after ServerChangeScene

Here’s a problem I’m running into, ClientRPC’s are all fine and happily running, until I run ServerChangeScene, and then they just start failing silently.

So if I have something like this:

[ClientRpc]
public void RpcPrintSomething() {
  print("Something.");
}

void Update() {
  if (!isServer) return;
  if (Input.GetKeyDown(KeyCode.A)) {
    RpcPrintSomething();
    print("RPC Method has (apparently) been called.");
  }

  if (Input.GetKeyDown(KeyCode.S)) {
    networkManager.ServerChangeScene("NewScene");
  }
}

I’m able to press A and see both “Something” and “RPC Method has (apparently) been called.”

But then if I press S, and move to a new scene, and then press A, I just see “RPC Method has (apparently) been called.” The RpcPrintSomething function has not run.

No error messages, no warnings. When I hook up the debugger with a breakpoint inside the RpcPrintSomething method, it never triggers when on the new scene, it is just failing silently.

What’s going on?

I’ve got this same issue, ever find a solution?

I’m afraid my solution was to remove multiplayer from my game… which is hardly the workaround you are looking for!

Given how easy it was to reproduce that issue I suppose I should have gone the proper route and reported it on the bug tracking system (if that was a thing, four years ago?) but Unity networking at the time was such a headache I just walked away from multiplayer. Sorry!

Soooooo, when you go to the new scene it calls the RPC method but does nothing? This may be a dumb question but is this code on an object that is in both scenes (not destroyed, etc.)? Because if you’re loading scenes and the object isn’t present then it wouldn’t obviously work.