Custom 3rd person camera clipping

Hello, i am having a issue of my custom 3rd person camera clipping throught parts. I looked at some other posts and tried it but i didnt work for some reason. Any help!

Current script

local uis = game:GetService("UserInputService")
local rs = game:GetService("RunService")
local context = game:GetService("ContextActionService")

local plr = game:GetService("Players").LocalPlayer

local Camera = game:GetService("Workspace").CurrentCamera
local mouse = plr:GetMouse()
local cameraDB = false
local zoomDB = false

local xAngle = 0
local yAngle = 0
local cameraPos =,0,8.5)

Camera.CameraType = Enum.CameraType.Scriptable

context:BindAction("CameraMovement", function(_,_,input)
	xAngle = xAngle - input.Delta.x*0.4
	yAngle = math.clamp(yAngle - input.Delta.y*0.4,-80,80)
end, false, Enum.UserInputType.MouseMovement)

	local c = plr.Character or plr.CharacterAdded:Wait()
	local rootPart = c:FindFirstChild("HumanoidRootPart")
	if c and rootPart then
		local startCFrame = +,2,0)))*CFrame.Angles(0, math.rad(xAngle), 0)*CFrame.Angles(math.rad(yAngle), 0, 0)
		local cameraCFrame = startCFrame + startCFrame:VectorToWorldSpace(,cameraPos.Y,cameraPos.Z))
		local cameraFocus = startCFrame + startCFrame:VectorToWorldSpace(,cameraPos.Y,-50000))
		Camera.CFrame =,cameraFocus.p)

1 Like

To make a poppercam you would wanna raycast from the origin part of the camera to the camera’s position to see if there is something in between. If the raycast hits something then you can get the magnitude between the camera position and the hit point and move the camera in by that magnitude. It’s kinda hard to make a good poppercam that doesn’t always have some clipping issues