Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Question 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:
    17
    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:
    17
    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:
    17
    ok extra cop spawning fixed aswell