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]