Character movement doubled if attached to moving actor(pawn)?

Hi,

i found a kind of quick’n’dirty workaround for this problem, it’s caused by the CharacterMovementComponent.

I have created a custom CharacterMovementComponent in c++ and i have overridden the void UpdateBasedMovement(float DeltaSecons) function. This function applies the velocity from the Actor the Character is standing upon to himself. If the character is attached to this actor he gets twice the velocity of the moving Actor.
Take a look at
https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Private/CharacterMovementComponent.cpp

I copied the whole function and just prevented the position update while leaving the rotation stuff as is.

For implementing a CustomMovementComponent see A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

I also noticed that i have to turn of ImpartBaseMovement for correct jumping results, otherwise the character will be pushed forward while jumping.

Hope this helps :wink:

2 Likes