How do I change functionality in classes like UCharacterMovementComponent?

I want to make changes to UCharacterMovementComponent to try to get non-capsule collision working. I tried copying the code from charactermovementcomponent.h and charactermovementcomponent.cpp separately into my own class and doing a search and replace to change “CharacterMovementComponent” to the new name. This doesn’t compile and I get a bunch of “inconsistent dll linkage” errors, which I assume has something to do with missing .generated.h files?

I realize I’m completely on the wrong track here. My question is basically what the best way is to change the functionality of classes like UCharacterMovementComponent. Do I change the source code directly? Do I derive from it and try to override its methods?

Sorry if this is a really vague question but I’m really confused about this and can’t find any resources.

1 Like

If you have your engine installed via EGS, the best you can do is derive and try overriding stuff.
If you have it compiled from source code, you can try changing the code directly.
But depending on the movement complexity that you’re after, maybe you can simply create your own lighter class, using UCharacterMovementComponent as reference.


My account was on hold or something so didn’t check the replies until now, but I actually ended up doing exactly this and created my own class derived from UPawnMovementComponent.

I do have it installed via EGS, so thank you for clarifying that as well!