How to call RPC in a new player?

Options
Hello! I have a game time, hours and minutes in my room. What is the best way to pass the two parameters to the newly entered player from the client's master? I'm using Photon Cloud, thanks!

I use:

private void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
{
if (PhotonNetwork.isMasterClient)
{
how receive RPC?
}
}


Can I call an RPC with a player ID?

Comments

  • Hi @AkaruZ,

    you can use a PhotonPlayer as parameter when calling the RPC. Since you want to do this in OnPhotonPlayerConnected callback, you already have this value.

    For synchronizing game time the better way might be to use the Custom Room Properties and store the value from PhotonNetwork.ServerTimestamp either after the room has been created or when the game is started by the MasterClient. Having the start time stored allows each client to calculate the past time on their own.