Issue with choppy animations on replicated client

For the sake of getting the most responses I have crossposted this from reddit. Any help would be amazing.

Ended up solving this one myself. The problem with the code was my client and server being off sync with their respective character movement modules. I was only changing the speed on the server with my replicated function instead I should have been using netmulticast to change the speed for everyone at once, and I used a USTRUCT and attached a UPROPERTY(ReplicatedUsing=OnRep_RunStateChange) to transmit a run state change that would trigger the local animation state machine so my animations would play when running.

FYI, this only works when you have no network latency.

Do you have a better solution to the issue? If so please post it. Your comment serves no purpose in educating anyone that ever finds this and needs help with a proper solution.

Well it does serve the purpose that people will know that this only works for LAN which is an important piece of information. The reason I don’t give a better solution here is because the solution is not trivial and requires some background knowledge on how the character movement component and prediction in general works. More on this topic can be found in the documentation Character Movement Component | Unreal Engine Documentation