How to collide camera with walls and floors but not thin objects

I have recently found this breakdown on artstation for getting a similar camera to Mario Odyssey. And after researching I haven’t been able to find any documentation about this problem.

I have slowly been implementing his C++ code and solutions using blueprints but I am having trouble with moving the camera along the arm when its a thick object and not moving when its a thin object.
I know I could setup different collider channels and do it on a per object basis but I would much rather just make a system for the camera that works with any environment like in the breakdown.

My current code is to do a sphere trace from the camera and if the distance from the hit and the camera is < 100 units then I do another trace from the player and move the camera to that new hit on the other side of the wall. My math here seems wrong and the camera isn’t moving along its forward vector and I know its not what the original theory is and I need help understanding it.

Here is my current code:

I’d really appreciate any help or insight on this as I have been searching for the past few days.

Regardless of the logic you posted, I think the collision built into the spring arm will get stuck at a wall even if you teleport the camera away. They are two entirely different components. I don’t know if you can “teleport” only the current endpoint of the spring arm to the other side… If you can do that the attached camera will follow automatically.