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

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

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

Raj
2022-11-19 18:56:41

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
2022-11-28 10:33:21

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
2022-12-18 14:43:36

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

Back to top