Hello, I’ve tried to create a sliding system using a timeline. The timeline is set to a length of 0.75 and lerps the sprinting speed to the crouch speed while setting the max walk speed on the character. I then call a server event updating the max walk speed on the server as well.
But every time I try to slide it works but stutters on the client. The stutter doesn’t seem to be as bad the lower the framerate is. I know it’s bad to call server events like this but I’ve tried everything I can to get this to work and looked everywhere online for a solution. Here’s a video of the problem.
If anyone can help me out here I would really appreciate it, because I’ve been stuck on this for a week now.
I had a similar stuttering issue with player crouching which I fixed by using a replicated variable to store the interpolated value.
I think your issue is the server and local player are both trying to do the same thing but there is a delay between the values. Maybe try setting the max walk speed using a replicated variable then only updating the replicated variable on the server and set replication condition to “skip owner”
Hi, thanks for the reply. Would you be able to screenshot or send a more detail reply on how to do this. When you say replicated variable is that repnotify or just replicated and using a event to update the server like this.
This way the speed variable will get updated on the server and replicated to all other players but there will be no conflict with the local player who is setting the variable. Set max speed does not need to replicate only the variable that is setting the speed
Sorry just realized you will have to check “is locally controlled” before setting the replicated variable so other players don’t overwrite it and send it to the server but “set max speed” needs to be separate as that does need to execute on all players, so something like this
I’ve tried something like this already and it still doesn’t work. Maybe timelines just can’t be used in this way when it comes to networking but I can’t think of another way.
You cannot do what you want to do in Blueprint with Unreal’s default character movement component. You have to do it in C++ and use the network prediction interface correctly. It’s really not as easy as just calling a few RPCs in Blueprint unfortunately. Check out the documentation for more info:
In your version you are sending an RPC to the server every time the client timeline updates. This means when the client updates the server is getting a command to “restart” its timeline slide. “Play From Start”.