Freecam Collisions

Hello! Today I am trying to make in this script:

local function StepFreecam(dt)
	local vel = velSpring:Update(dt, Input.Vel(dt))
	local pan = panSpring:Update(dt, Input.Pan(dt))
	local fov = fovSpring:Update(dt, Input.Fov(dt))

	local zoomFactor = sqrt(tan(rad(70/2))/tan(rad(cameraFov/2)))
	cameraRot = cameraRot + pan*PAN_GAIN*(dt/zoomFactor)
	cameraRot =, -PITCH_LIMIT, PITCH_LIMIT), cameraRot.y%(2*pi))

	local cameraCFrame =*CFrame.fromOrientation(cameraRot.x, cameraRot.y, 0)**NAV_GAIN*dt)
	cameraPos = cameraCFrame.p

	Camera.CFrame = cameraCFrame
	Camera.Focus = cameraCFrame 

Camera collisions,it won’t collide with other objects but I don’t quiet know how. If you want more info lmk!

1 Like