Are there resources on how to overwrite ACharacter's crouching behavior?

I’m looking for ways to overwrite the crouching system in ACharacter. It’s mostly doable by overriding the various functions, but the variable bIsCrouched keeps being overwritten to false. I really dislike the original ACharacter crouch system, but at the same time, I’m trying to avoid creating new members and methods with names similar to the original, as it would make the code very hard to maintain in the long run, I imagine.
I’ve spent a few hours trying to figure out how the system works in ACharacter and UCharacterMovementComponent, but I can’t really figure it out. Do I have to create a new, separate variable bIsCrouching to solve this? Any resources that explain the source code are more than welcome.

Set a breakpoint where you set the variable to true, and then set a data breakpoint on it to see who sets it back to false.

yeah i wouldnt overwrite it, id create my own, on one hand you say thats more confusing but personally i think altering the original could be more confusing as it may not work as expected

1 Like