3D Raycast causing camera to not turn anymore

I searched up the forums for a way to prevent my camera (third-person 3D) from clipping through the walls whenever i turn towards them.

I found a code and then made it but when I decided to test it, I couldnt move my screen at all. It was fixed to one direction. I made my character walk towards a wall and it zoomed in and not clipping through as intended. Now im a little stumped on how to fix the camera part now.

Here is a screenshot of the code i used

If you are using a behavior for the camera, remove the last event and set the distance with the behavior instead.

Sorry but i dont seem to understand this

Nevermind I figured it out, thanks!