Could anyone give me some tips on how to override/implement character movement component events in my custom C++ character? For example, blueprint events like ‘OnWalkingOffLedge’.
I’ve managed to override the ‘OnLanded’ event but, unless im doing something wrong, other CMC events dont seem to be overridable in the same way.
Yea, I wouldn’t touch the movement component it a 2m pole…
I know this was not very helpful but if you are not in production you might be interested in tinkering with Mover. (it will hopefully replace the Movement Component at some point)
I’ve not have a chance to look at it in depth but I hear it is much more modular and open.
Hey there, I’m actually researching this class as well!
If you need deep customization, you’ll inevitably have to read its source code.
However, CharacterMovementComponent is one of the most complex classes in Unreal Engine—the CharacterMovementComponent.cpp file alone has over 10,000 lines of code.
Here’s a rough breakdown of how it works:
The movement input vector from the controller is stored.
Inside UCharacterMovementComponent::TickComponent(), this input is processed.
It gets passed into UCharacterMovementComponent::ControlledCharacterMove().
Then it goes into UCharacterMovementComponent::PerformMovement().
Finally, it reaches UCharacterMovementComponent::StartNewPhysics(), which is a core function — I highly recommend reading its source code.
This function handles various movement states like PhysWalking, PhysFalling, and PhysFlying.
But be careful—these states can switch between each other, sometimes even multiple times within a single tick.
I think you might need to override UCharacterMovementComponent::PhysWalking() or UCharacterMovementComponent::PhysFalling().
You can create a subclass of UCharacterMovementComponent, override these functions, and instead of calling the parent class’s implementation directly, copy the original implementation and modify it as needed for deep customization.