Download

Client Movement is stuttering and Animation isn't played correctly

I have a weird issue where the Client’s Version of the Location is stuttering when running fast and the Blendspace is played way too slow.

https://streamable.com/x6mqe
The client is right, the Server is left.

My Controller looks like this:

My Pawn looks like this:

My AnimBlueprint looks like this:
e7d69bb318c997e5e97044371a0b04a73bfa68be.jpeg

The Rule from Idle to WalkRun(Blendspace) like this:
4089d2c6b728f21b98238e6a19561ecfe9a6fcf7.jpeg

What do I do wrong?

Edit: I observed that the Client Character does not reach 480 Velocity, only ~350.

Your client movement speed remains at 350.

When the client asks to move, it says it’s moving by 350 units / second on the client and 480 on the Server which means he’s always behind on the client.

The movement is replicated and the server fixes the location of the client a step forward, everytime movement replication kicks in. That’s where your movement jitter comes from.

The solution here is to set the new movement speed on Client as well (you might as well also try to set it only on Client to see if it works, it might since the CharacterMovement component does a lot of stuff that I don’t know regarding replication).

Not replicating does not work.

How can I accomplish this?

Edit:
57ad174499a4180988c2e0b3f5c945571cab5238.jpeg

It works now, but I’m unsure if this is the correct solution…
Why do I have to create an Event for the Client and one for the Server?

Because it looks like setting the MovementSpeed on Server does not set in on Client and vice-versa.

So if you want your Client to have the same speed on the Server, you’ll have to set it twice.

That’s how I understand it.

I restructured the pawn. I now set a boolean instead of setting the Max Walk Speed. The Max Walkspeed is set to the absolute maximum (480) and the boolean changes the movement speed in the AddMovementInput.