Why RPC's don't execute in additive scene?

Options
I load main scene and via script load additional scene with UI.
void Start()
{
        photonView.RPC("LoadUI", RpcTarget.MasterClient);
}

[PunRPC]
private void LoadUI()
{
      SceneManager.LoadSceneAsync(UISceneName, LoadSceneMode.Additive);
}

There is a script in the UI scene that allows masterClient to start and stop a timer that is reflected to all players. Starting and stopping are done via RPC methods.
public void StartTimer()
{
    StartButton.gameObject.SetActive(false);

    photonView.RPC("ShowTimer", RpcTarget.All);

    StopButton.gameObject.SetActive(true);
}

[PunRPC]
public void ShowTimer()
{
    Timer.gameObject.SetActive(true);
}

public void StopTimer()
{
    StopButton.gameObject.SetActive(false);

    photonView.RPC("HideTimer", RpcTarget.All);

    StartButton.gameObject.SetActive(true);
}

[PunRPC]
public void HideTimer()
{
    Timer.gameObject.SetActive(false);
}

When the UI was not a separate scene, everything worked fine, but after the separation the RPCs doesn't execute.

Answers

  • Tobias
    Options
    It's unlikely the issue can be explained by looking at the code (which was working before).

    Make sure the RPCs are called (on the client that attempts to call them and all other clients in the same room, too). Look out for any exceptions and or messages in the logs.