How to properly set collision when "rolling" under obstacle?

What I am doing:

I am creating a Roll/Dodge system and would like some guidance on creating an obstacle the character must roll under. Currently, I have the animation and blueprints working as intended. See picture 1 for roll/dodge blueprint (currently collapsed into a macro), and picture 2 for the obstacle.

What I have tried:

I have tried setting the character’s capsule component half-height (only while rolling) to half the initial value (from 96 to 48) then after a short delay, it resets back to the initial value. This allows the player to roll under the obstacle just fine. However, they also clip into the floor; not intended. Below is the blueprint code.

I have tried giving the obstacle a custom collision channel. When the character rolls, the character’s capsule component briefly ignores that specified channel. The player rolls under without clipping into the floor; progress! However, it looks weird because it can clip into the obstacle itself. Below is the blueprint code.

What are your suggestions/comments/questions?

As they roll the capsule shrinking won’t be towards their feet, It will shrink towards the center of their body. If your animation plays at ground level you can either also offset your character mesh up during the roll or offset the animation.

Would this be better than messing with the obstacles collision? Basically I want to go with what’s going to be more efficient.

I believe Unreal already has some behavior for crouching. You might want to look into that. I would say that resizing the capsule is better because it may be helpful on cases where its not just an obstacle you have placed, like dodging projectiles or vehicles.

Crouching isn’t the intended function though. I have crouch already blueprinted. I want to roll as well for dodge mechanics (combat, which I have) and to give players more options for traversal.

For example, rolling will get under short, low hanging ledges; meanwhile, crouching (through unlocking later Metroidvania style) will get under longer, low hanging corridors.

Is there a way to offset or move the capsule’s resizing to the ground/floor, so it resizes from the top down to half height? IOW, set the capsule’s point of resizing change to remain constant at the ground level. It seems that if you can resize a cube or sphere at its bottom corner, as can be done by switching the location of the widget in the editor, you can also change that resizing function inside a blueprint. Not sure how to do it though.

That’s what I was thinking about doing, just not sure how either. I was hoping to get insight. Thank you for the option!