Stop camera lean when hitting wall

Hello! I recently attempted to make a leaning system in my game and I like what I have thus far. The leaning is controlled by moving the mouse left and right so leaning can be done in many angles. The problem I face is that the camera clips through the wall.

Things I attempted:

-Adding a collision to the camera, but I was unable to find a way to detect collision with a wall and stop rotation.

-Spring arm, but it didn’t really do anything to stop the collision on lean.

I feel I might be missing some simple solution possibly, but I am unable to find anything else online that poses a possible solution thus far from what I can find. Any help is greatly appreciated!

[Video Example][1]

Note: I did fix the camera and spring arm target discrepancy for the lean toggle button.

Another solution I attempted was to tilt the entire character, but it now has the extra issue of being able to clip through walls and teleport through them…

I managed to resolve this by moving the spring arm closer to the camera. It actually leans quite far without leaning out of the player collision and clipping a wall. The spring arm is the target of rotation.