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.
The reason the camera snaps up and down is because it’s attached to the head, which instantly snaps into place with the rest of the character as you can see in the alternate view camera.
You can maybe alleviate that issue by using camera lag (bad idea for first person camera)… But the right way to do it would be to just smooth out the animation properly. E.g. if you fix the problem of your character teleporting downwards, you will fix the issue of the camera snapping too.
If I were to hazard a guess about why your character sinks into the ground like that, it’d be that your crouching animation/pose is somehow what’s causing it. Seeing as you can still move and don’t fall through the level, your collision capsule is where it’s supposed to be, only your mesh is moving out of position, which is typical for animation issues, not a 100% on how to actually fix that but I thought I’d at least point you in that direction.