I’m running into some issues with my rolling system. My roll animation has a bit of vertical movement, and I want to keep that vertical movement, but I don’t want the camera to bob up and down—similar to how it works in ELDEN RING. I tried locking the camera boom’s location.z during the roll, but this method stops working when I’m locking onto an enemy, and it also causes problems when rolling on slopes. Has anyone solved this issue before?
Just a guess, I think you parent your camera boom to the mesh, right? You can try to parent your camera boom to your capsule component instead in your character class blueprint.
Sorry, I forgot to mention that my dodge/roll uses root motion for movement. Because of that, the issue still happens even if the camera boom is attached to the capsule component.
But thank you for the help!
If so, your post tag should be under animation. Anyway, it should not inherit any animation movement if you put it on a capsule component. A short video about the problem will help me see it better.
Here’s the video. To preserve the vertical movement of this roll animation, I set the movement mode to Flying during the roll.
If the movement mode is Walking, it seems that UE5’s root motion can’t produce any vertical movement.
Yes, if you want the root motion to inherit the z-axis transform, it needs to be set as flying. I see it now. You see, the camera is set to follow your capsule component, and when flying, it inherits the z-axis transform of the capsule component, thus causing that weird up and down camera movement.
There are multiple ways you could fix that camera’s weird movements. The quickest cheat that you can do is to use the camera lag function. A more complex way might need some experimentation to see what’s best.
Right now my workaround is to save the camera height at the start of the roll, and then keep locking the camera to that height during the roll.
However, this causes issues when the character is rolling on slopes.
What I really want is to extract only the vertical displacement from the root motion every frame, but it seems that UE5 doesn’t provide a way to retrieve only the vertical component of the root motion.