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. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

[PUN2] Late joining players don't see any changes made in the scene

Discussion in 'Multiplayer' started by Rajkumar-Darbar, Nov 19, 2022.

  1. Rajkumar-Darbar

    Rajkumar-Darbar

    Joined:
    Mar 1, 2015
    Posts:
    7
    I am trying to build a simple FPS multiplayer game using Photon PUN 2. In my game, there are some targets, and players can raycast at them to change their color. I am using RPC with RpcTarget.AllBuffered. Everything gets synchronized well if players join in the room first and then start shooting at targets. Unfortunately, late joining players in the room don't see any changes made so far by other players.

    In my code, I used:
    PhotonNetwork.AutomaticallySyncScene = true;
    PhotonNetwork.LoadLevel(1);

    Any help to fix this issue would be much appreciated. Thanks in advanced.
     
  2. Strafe_m

    Strafe_m

    Joined:
    Oct 24, 2022
    Posts:
    72
    My guess would be that your only changing it for the current players in the room, so people who join late won't receive the RPC
     
  3. Rajkumar-Darbar

    Rajkumar-Darbar

    Joined:
    Mar 1, 2015
    Posts:
    7
    Yeah, you might be right. I was wondering how to send RPC for both current and late joining players? Any sample code ?
     
  4. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    455
    RPC's that arent buffered for all will be lost. Thats all that is happening. You need to ensure they all recieve those packets if it matters.
     
  5. Rajkumar-Darbar

    Rajkumar-Darbar

    Joined:
    Mar 1, 2015
    Posts:
    7
    I am already using RpcTarget.AllBuffered. This is not working for the late joining players. What are other options to make buffered RPC?
     
  6. Strafe_m

    Strafe_m

    Joined:
    Oct 24, 2022
    Posts:
    72
    Maybe try AllBufferedViaServer, not really sure on this one
     
  7. Rajkumar-Darbar

    Rajkumar-Darbar

    Joined:
    Mar 1, 2015
    Posts:
    7
    I tested AllBufferedViaServer too. But not working in my case.
     
  8. Strafe_m

    Strafe_m

    Joined:
    Oct 24, 2022
    Posts:
    72
    Maybe for the players who join late, send the RPC to them when they join?
     
  9. Rajkumar-Darbar

    Rajkumar-Darbar

    Joined:
    Mar 1, 2015
    Posts:
    7
    That might be a way out. I will try to implement that and post update here. Thanks!!