Search Unity

Third Party how do i fix objects not deleting and in an rpc values not changing Photon PUN2

Discussion in 'Multiplayer' started by LittleTimmy52, Aug 27, 2022.

  1. LittleTimmy52

    LittleTimmy52

    Joined:
    Jan 10, 2022
    Posts:
    18
    when someone gets a chance, I have a couple problems in changing values and deleting objects for all clients with photon Pun2, I cant seem to find what is wrong, the bounds dont change when the rpc changes them, the flag dosent get deleted when a client other than master collids with it, and when all the cops get deleted it somehow triggers one more to spawn, I cant find out what is causing it, any help would be nice
    my scripts: http://pastie.org/p/5L1OHMmjdujod6HMueOBfg http://pastie.org/p/67rBDJaDbpGZDDY5SVtbst

    edit:
    my rpc for changing the menues only works for the client who called it but no the others, i need this to be fixed but i have not the slightest idea of how
    code:
    public void StartGame()
    {
    // code not nessecary for my question here

    // sets canvases
    view.RPC("RPC_ChangePauseMenues", RpcTarget.All, false);
    }

    [PunRPC]
    private void RPC_ChangePauseMenues(bool isInLobby)
    {
    pauseMenuLobby.SetActive(isInLobby);
    pauseMenuGame.SetActive(!isInLobby);

    isPaused = false;
    SetPaused();
    }
     
    Last edited: Aug 27, 2022
  2. LittleTimmy52

    LittleTimmy52

    Joined:
    Jan 10, 2022
    Posts:
    18
    I found the issue with the flag but the other problems still persist and i still am stuck
     
  3. LittleTimmy52

    LittleTimmy52

    Joined:
    Jan 10, 2022
    Posts:
    18
    ok extra cop spawning fixed aswell