How can I create a camera roll during a lean?

Hey guys! I have recently created a lean mechanic for my game, however I cannot seem to get the camera roll working. I simply want the camera to “lean” with the player when the input is pressed. Is there a way to achieve this effect? This is in first person! Thanks a lot!

You can achieve this easily using the “Spring Arm” no doubt you have one on your character already connected between you and the camera.

Spring Arm Howto

Here is a great start to understanding what you can do with it.

Would this work on a first person game?

If you add a spring arm certainly, you will find that the character arms and stuff will need corresponding animations to have it look right.

For first person, you need not a spring arm you can do the job of one in this case.

You use the rotate vector to rotate around some offset perhaps your origin or your hips. then apply that rotation to your camera.

You could also just rotate your Character, so that if someone looks in a mirror or similiar, he would at least see some kind of real movement, even if it’s very basic.

Could you possibly send a screenshot of a setup that works? I have been trying methods similar to this, however I never seem to be successful.