Scriptable Camera Problems!

Hey guys! I recently made a scriptable camera setup that looks something like the indoors in Loomian Legacy. And I also bumped into a few problems so can anyone figure it out?
I didn’t record this video in my real game. I just copied the code and made a few parts.

Screenshots & Videos

The part on the left deactivates the scriptable camera, called ChangeCam2
The part on the right activates the scriptable camera, called ChnageCam

The video quality might be bad.

Problems
  1. I can see through a wall. I can edit my walls to make it look good, but is there anyway to stop the player from seeing through a wall?
  2. My head is a bit (actually super) shaky. The cam doesn’t shake because the CameraSubject is the HumanoidRootPart
  3. The camera doesn’t change back to what it should be.
    I haven’t found any solutions to these three on the internet yet.
Script
local function CamCFrame(position, lookAt)
	local lookVector = (lookAt - position).Unit 
    local modelUpVector = Vector3.new(0, 1, 0)
    local rightVector = lookVector:Cross(modelUpVector)
    local upVector = rightVector:Cross(lookVector)

    return CFrame.fromMatrix(position, rightVector, upVector)

end
local camera = workspace.CurrentCamera
game.Players.LocalPlayer.CharacterAdded:Wait()
local character = game.Players.LocalPlayer.Character
workspace.ChangeCam.ClickDetector.MouseClick:Connect(function()
	camera.CameraType = Enum.CameraType.Scriptable
repeat wait(0.01)
    camera.CFrame = CamCFrame(character.HumanoidRootPart.Position + Vector3.new(11,10,0), character.HumanoidRootPart.Position)
until camera.CameraType == Enum.CameraType.Follow
end)
workspace.ChangeCam2.ClickDetector.MouseClick:Connect(function()
	camera.CameraType = Enum.CameraType.Follow
end)

You’re supposed to change the camera back to Custom

U can use raycasting to make the camera not able to go trough walls

I set my game to use follow.
Or can I switch it to Custom then Follow?

This should be able to give you an idea of a solution for the walls.

https://developer.roblox.com/en-us/articles/customizing-the-camera

I didn’t use invisicam, and my walls have a 0 transparency.