Adding custom information to ClientAdjustPosition

I am working on a project with substantial custom movement logic built on top of the CharacterMovementComponent, and I have encountered a situation in which during a correction I would like to force the client to adopt the servers view of some of the associated state. My understanding is that this is usually done via ClientAdjustPosition, where things like movement mode, movement base, etc are set to match that of the authority. I would like to add to this list of properties that are set during a correction, but as I understand it there is no clear extendable way to do this. Am I missing a place where this can be done? If not, do you have any suggestions as to how to do this without making significant engine changes?

Thanks!

Hi,

This can be done by creating a custom struct for your move response derived from FCharacterMoveResponseDataContainer.

This derived struct can include the extra data needed as member variables. ServerFillResponseData should be overriden to set the new member variables using the CMC state, and Serialize should be overriden to save/load the new member variables to/from the passed in FArchive.

Finally, your CMC can be set to use this new container by calling UCharacterMovementComponent::SetMoveResponseDataContainer.

Thanks,

Alex