My crouch system is a lil bugged

Hi all, I’m brand new to UE5 (please go easy), learning from youtube tutorials.

I’ve made a basic crouching system which is ran by a flip flop and is toggled by pressing Shift. You can also uncrouch by pressing Spacebar (it’s a work in progress).

My issue is that when you crouch, instead of the camera smoothly following the character’s head, it instead snaps into a lower position to match the position of the player’s head.

What’s more is that the character will phase through the floor when you crouch. (This is fixed by matching the capsule half height with the standard standing height, but this removes the crouch functionality so messing with that is a no-go.)

Attached is a blueprint of my code, and a demonstration of my issue.

Would the fix lie in messing with the locomotion settings in the AnimGraph? Any help is greatly appreciated.