Rolling the camera's view smoothly...

I’d like to know how I can get a camera component to rotate on the X axis smoothly when my player leans to the left or to the right. Seen below, I achieved this effect, but in a very inorganic manor that just snaps the player’s view to the location and rotation desired.

With my new script, seen below, I believe that I am actually rotating the camera component based on what is written in the blueprint, but the angle of roll does not change in-game. I tried to test rolling the camera by physically turning the camera in the viewport editor (on the X axis), and although the component was rotated, my player’s view did not change. The player’s view remained parallel with they global XZ plane.

Is there anything I can do to rotate the player’s view as I rotate the camera component? Is there another work around other than the script I have written to enable smooth camera rolling? Thank you in advance!

After the greater part of a day, I solved it! The issue did lie with my camera component. There is one setting that I enabled to get my old mouselook script to work, that, upon disabling, allowed me to rotate the camera on leaning. I can still use the leaning script that was posted in the question without any changes being made.

Here is my fix:

52963-cameracomponentsettings.png

On the camera component, “Use Pawn Control Rotation” should be disabled.

This needed to be changed in my mouse look script (for only the Y axis)

My character can now lean around corners smoothly!

Can your character look up and down?

Sorry i see your modification on mouse imput.