Health is default for players that joined after health is changed
So Player 1 has 100 health. Player 2 Shoots Player 1 Which makes player 1's Health be 50
Player 2 leaves. Player 1's health still 50. Player 3 joins game. Player 3 Sees player 1's health as 100 even though he has 50. player 3 shoots player 1 and deals 50 damage. Player 1 dies but for player 3 his health is at 50 now. How can I fix this? I use a RPCTarget.All for health change
Answers
-
There's something called IPunObservable that you are supposed to use to sync values like that. Here is a tutorial that will show you exactly what you need to know. YouTube video: https://www.youtube.com/watch?v=1-zX0E1YBH8&t=210s&ab_channel=DitzelGames
0 -
Keep in mind that the context of the video is different from your scenario with the healthbars but pay attention to how values are streamed/synced over the network with the method shown in the video.
0