how to smoothly rotate the camera along the X axis?

I don’t know how to explain it in English, but I have a first-person character, and I want my camera on the character to rotate along the X axis depending on the direction of movement (right or left). How can I do this on a blueprint? I hope you understand me