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?