I made a multiplayer game in which the player has a stamina value changing when he runs. The variable is in the player bp and I'm calling a server event to change it.. However, when the Host loses stamina, the client loses some too; and when the client loses some, nothing happens; it's resetting to 100%.
What am I doing wrong? Thanks.
asked Dec 22 '16 at 10:31 AM in Using UE4
Ok, here is what seems odd to me. In Capture4,png Gain Endurance and Lose Endurance are set to replicate to server, but you are already on the server side. This could either not work entirely or create a timing issue. Try changing these two events to not replicate. I'm not sure what Endurance to Blur does, so I don't know if that is affecting you.
The delay in your Lose Endurance event could also be causing you timing issues. I would try changing the Gain Endurance and Lose Endurance events first, but if that doesn't work, take a look at the Delay node. Try removing it for testing. If that fixes it, try changing the Delay to a Set Timer node.
Also, just a personal preference of mine, but I do not use Event Tick. In theory I guess there might be times when you need it, but I have always found a way to do the same thing without using Event Tick. If used incorrectly, Event Tick can be a performance nightmare. So just something to keep in mind if you run into performance issues. In your case it probably isn't having any effect.
answered Dec 23 '16 at 02:30 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here