Third Person Camera - Collision
So I've been working a lot on my third-person camera and it's working pretty nicely. I have recently been trying to get camera collision working to stop the camera from clipping through the game world. I have this partially working. If I do indeed clip into an object it zooms me out. However, this zoom often involves going directly through the object in the way, causing clipping. Ideally I want it to completely avoid going into the object. My current code is below:
Does anyone have a suggestion for fixing this issue. I thought maybe I could add a collider to the camera? Would that generally be seen as an efficient way of fixing this?
Any advice and improvements wouldn't be gratefully received.