Replicating/Updating variables in player state
Hi guys, I seem to have got into a bit of a predicament. I store main player stats in my player state (to prevent client hacking on my mp game). I have some stats working such as the players level, I have a debug function that runs on the server when I press "E" and this shows the payers in the server with their level and attack damage. Levels show up fine each player has their own, but the attack doesn't show up for the client it stays as "0" whereas it updates for the server player.
This is the talent tree widget that the client uses to select the talent attack increase. Top left shows the client printing the attack is "10"
Here I have used the debug function on the server (client is player ending in 564D) as you can see both are still 0
Here the server uses the talent widget and selects the attack talent point
This shows the debug and shows the server character with the attack increase
So obviously the clients variable isn't replicating and only setting it on the client itself.
asked Jan 27 '16 at 06:53 PM in Blueprint Scripting
As you can see levels are different and both the server and client have selected the attack talent and works fine :)
I basically added a custom event in the player state that runs on the server so the server knows to change the variable. After that it worked fine, I then realised the characters damage wasn't updating, so looking at my character damage blueprint, I casted get player state from self instead of player controller and it worked :)
answered Jan 27 '16 at 08:49 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here