late joining players don't see any changes made in the scene

Options

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.

Comments

  • Tobias
    Options

    Don't buffer shots. They will be stored on the server and sent to joining player (no matter how much later it is). Health should be synced instead. Getting an up to date value on join will be enough to know everyone's HP.

    late joining players in the room don't see any changes made so far by other players.

    You didn't explain which changes you expect synced.

    Check this doc for generic advice on how to sync stuff.

    Maybe Fusion is a better match for your game. It allows you to mark fields as Networked and this keeps the state in sync for late joiners. It's also a better match for shooters.

  • Raj
    Options

    Hello Tobias,

    Thanks for the suggestion. I was expecting to sync the changed color of a target for late joining players.

    I was able to solve it using photon custom properties. I have posted my solution with sample code in the Unity forums. Link is: https://forum.unity.com/threads/pun2-late-joining-players-dont-see-any-changes-made-in-the-scene.1363518/#post-8671149