Using Player Properties or RPC for Score Update .

Options
Hi,

Can you tell me which is better and more reliable to use if i want to update/Sync the score of players through network.

I have tried PlayerProperties to update the score of Players, However some times it do not reflect.

I guess i can do with RPC also (Not Tried).

Which one i should go for and Why


Thanks in Advance
Unity Learner

Comments

  • vadim
    Options
    Player properties is the best option for player scores. Look at UtilityScripts\PunPlayerScores.cs in PUN folder for a sample or use it as is in your project.
    What exactly does not work for you?
  • Thanks Vadim,
    Game i am working on is FPS. When one player shoots to another and it dies i increase the score by changing the player properties. Some times score do not get added up.

    It also happens that some times when two players shooting each other they both get died. It is ok ?
  • vadim
    Options

    Some times score do not get added up.

    Maybe you run in race conditions trying to update same player property from different client. Make sure that you do this on player's client only (use RPC to send 'hit' event from other client if required).
    It also happens that some times when two players shooting each other they both get died. It is ok ?
    Why not? If they both get hit.