I’m quite far in my project with photon unity, but i’ve run into a snag.
If player 1 kills player 2, and player 2 does not respawn, but player 1 logs out and logs back in, player 2’s health on player 1’s client is not synced with the health displayed on player 2’s client.
(meaning player 1 can kill player 2 infinite amount of times before player 2 spawns)
The question is… Can I assign a value to a specific photon player on the cloud?
for example, if I log in as “me” and “Host” on 2 different clients, if “Host” kills “me” and “me” Disconnects, I want “me” to log back in as dead, since “me” hasn’t respawned yet.
Any guidance on where to go from here? I’m reading I may need mySQL… another language I don’t know >.>
With my pretty basic knowledge of Photon, there is no easy way built in to do this. An alternative, as you stated, is a basic external text file or sql server, but for most games death doesn’t have to persist over moving rooms/disconnecting + reconnecting. You might be better off making death not persist if your game doesn’t rely on death persistence.
I have an idea…it is just an idea.
Everytime you join a room, go through the list of players. Not
PhotonNetwork.playerList, I mean actual players (hopefully you have tagged all players as “Player” or something so you can do this.
Go through the list of players, and for each player that is not you:
1)Is this player currently dead? If so, don’t have him be visible or killable on your client.
2)If this player has less than full health, update your client to say so.
3)If this player is holding an item, update your client to say so (and so on…)
Sorry if you have already done this. I hope this at least sparks something in your mind.