Download

Networked CharacterMovementComponent Custom Modes, Replicating Properties

Hi all. This is going to end up being a pretty specific question but I’m hoping someone else has had this same problem. Thanks in advance!

I’m trying to wrap my head around how the CharacterMovementComponent should be properly used to set up custom movement modes in a networked game. At the moment I’m trying to make my character dash/roll forward, in a fixed direction for a certain amount of time.

I have SetMovementMode replicating properly using an extended SavedMove to trigger the movement mode change but I’m stuck trying to get an FVector (the fixed roll direction) replicated properly between the client and server.
I was under the impression that I could pass the FVector through the SavedMove but have had little success. Also replicating the vector the standard way using lifetime replicated props only works at 0 latency.
Am I misunderstanding how SavedMove should work? Or is there some other way I should be replicating the vector?

Still poring over the 12000 lines of CharacterMovementComponent but would appreciate any insight into the problem.

P.S.
For anyone who doesn’t really know what I’m talking about but would like to this tutorial and this repo are the best resources I’ve found so far discussing it.

Honestly I never got around the FSavedMove, seems like something that is very hard to extend for a one-off movement. if you look at jump, its very complicated, and it shouldnt be.

for these kind of movement, I am using RootMotionSources. it is like an root motion animation, but instead of getting the transform from animation, you make a class that outputs the transform every movement frame.
you need to attach it to the character movement component, both on control, and on authority side.
it has some issues, but i think it is the way its meant to be implemented. just look up RootMotionSource_ConstantForce