Sending relevant data between clients on command (Not on realtime)

Options
FadiB
FadiB
Hello! I am new to Photon and I have been successful in setting up rooms and having clients connect to them, however I have a problem that I am not sure how to tackle. The problem is as follows:

I have a scene with 5 objects.

Two players are in the scene.

Both players can move around the objects in the scene but the information about the objects having moved should not be sent to the other client yet. (e.g player 1 cant see what player 2 has moved and vice versa)

After a timer has run out, the first player should get the information about all the objects that have been moved by player 2 and their new positions and vice versa for the second player.

Now the first player will update the positions of all objects that have been arranged by the second player, and the second player will see the objects arranged by the first player.

(Example: Object1 has position 0,0,0 for player 1, but Object1 has position 1,1,1 for player 2. When the timer runs out, Player one should now see Object1 on position 1,1,1 and player 2 should see the Object1 position as 0,0,0)

The first player can now rearrange the objects in the scene and the second player can rearrange the objects too, but this data wont be sent to the server.

Would a simple RPC function suffice as a method to send the data containing object positions to the other clients when the timer runs out, and then having the receiving client change the object positions as stated by the parameters in the function, or is there a better way to do this?

NOTE: I do not want the objects to continuously send their position to the server and having all clients update the data as that is not relevant for my project. Any relevant data should only be sent on command and updated for all clients respectively

Thanks in advance!

Best Answer

Answers