I’m working on a FPS project with blueprints and I face the following problem : only the player of the listening server can see his max walk speed changing.
Here’s the event on the character blueprint and the associated function :
It has to do with the way how listen servers work.
Only the server is allowed to do stuff. So if a client wants to change a replicated variable, he needs to tell the server to do so.
So what Fitiwizz does is, make a custom event that runs on the server but is called by the client. If the client presses the InputKey for sprinting, the event is called and passes the isSprinting bool. For pressed → true and for released → false.
Now, under the Input, you see the red part of the custom event. This runs on the server and sets the replicated variable “isSprinting” to true or false.
Nearly the same happens at the right side of his picture. He calls the custom event that runs on the server to change the movement speed of the Character Component that was passed at calling (so the one of the client).
For this RPC like network system, you need to realize, that every other player than yourself, is only a “bot” moving with the variables that the original one replicates. And the server is able to change variables of all these client bots and also change these variable on every one of your client bots.
So if Client1 Sprints, the server tells Client2 etc that Client1 Sprints. It also allows Client1 to sprint, because it changes the variable for him.
So on the server, you could also run some checks, to make sure that the player is allowed to sprint at all (cheating). But i guess it’s fine how he did it (:
Hey Fitwizz - I am running into the same issue here, however I lack the brains to understand what you have constructed here. Would you be able to post what steps you took to build the blueprints you posted?
That Event tick looks so bad and it’s not really needed.
The trick is setting the max speed on the client and on the server (the last one through RPC call aka Custom event on server)
iam confused, when i try to change the max walk speed the speed doesn’t change and the character keeps glitching, i’ve been trying to fix this for a week now