Using a timeline causes stutter/lag on the client

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.

Thanks.

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.

Try 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

Okay, so I’ve just done everything you said and the stutter is still there. I’ve added video so you can see the BP layout and the result.

Have you tried running the server through the exact same process?

Client input → switch has auth[remote] → Slide → Srv RPC
Srv RPC: switch has auth[auth] → slide

The jitter is the server correcting the clients max walk speed. They are fighting each other.

Server is the authority. At n game time speed should be n. inputs/rpc’s have timestamps.

Here’s what replicated sprinting looks like. Should give you a bit of insight to changing/setting cmc movement speeds.

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:

Hello friend, this is quite simple to


solve, just apply a movement input.
This in multiplayer will solve the bottleneck.

Call the client slide, then immediately call the srv slide. Then run the timeline.

e.g.


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”.