I have a fully functional third person camera script, everything works fine, except for one aspect, and that is the popper part of my script. I decided to use raycast position to identify where to move camera to if it collides with a part. Downside is, it works almost perfectly, but the camera just slightly clips through part, which in turns ruins what i wanted. Heres the popper part of the script, and is needed to note all of the function works as intended, only the popper wont work.
Camera.Focus= Character.PrimaryPart.CFrame
local Direction = (cameraCFrame.p-Character.Head.Position).Unit*((cameraPos)).Magnitude
local CheckRay = Ray.new(Character.Head.Position, Direction)
local Part, Position = game.Workspace:FindPartOnRay(CheckRay,Character,false,true)
if Part then
--local Distance = Camera:GetLargestCutoffDistance({Character}), decided not working well either.
local x,y,z= Camera.CFrame:ToEulerAnglesXYZ()
Camera.CFrame= CFrame.new(Position)*CFrame.Angles(x,y,z)
end
If you need the full script, i would be glad to post it here, seeing as i most likely will make a public script. Thank you!
