Camera Collisions

How do I fix a players camera being able to go through a semi-transparent wall?

2 Likes

If you’re using default scripts, take a copy and go into Popper then modify this function:

local function canOcclude(part)
	-- Occluders must be:
	-- 1. Opaque
	-- 2. Interactable
	-- 3. Not in the same assembly as the subject

	if FFlagUserPoppercamLooseOpacityThreshold then
		return
			part.Transparency < 0.25 and
			part.CanCollide and
			subjectRoot ~= (part:GetRootPart() or part) and
			not part:IsA('TrussPart')
	else
		return
			part.Transparency < 0.95 and
			part.CanCollide and
			subjectRoot ~= (part:GetRootPart() or part)
	end
end

image

2 Likes

I don’t have that function?

--[[

BaseOcclusion - Abstract base class for character occlusion control modules

2018 Camera Update - AllYourBlox

--]]

--[[ The Module ]]--

local BaseOcclusion = {}

BaseOcclusion.__index = BaseOcclusion

setmetatable(BaseOcclusion, { __call = function(_, ...) return BaseOcclusion.new(...) end})

function BaseOcclusion.new()

local self = setmetatable({}, BaseOcclusion)

return self

end

-- Called when character is added

function BaseOcclusion:CharacterAdded(char, player)

end

-- Called when character is about to be removed

function BaseOcclusion:CharacterRemoving(char, player)

end

function BaseOcclusion:OnCameraSubjectChanged(newSubject)

end

--[[ Derived classes are required to override and implement all of the following functions ]]--

function GetOcclusionMode()

-- Must be overridden in derived classes to return an Enum.DevCameraOcclusionMode value

warn("BaseOcclusion GetOcclusionMode must be overridden by derived classes")

return nil

end

function BaseOcclusion:Enable(enabled)

warn("BaseOcclusion Enable must be overridden by derived classes")

end

function BaseOcclusion:Update(dt, desiredCameraCFrame, desiredCameraFocus)

warn("BaseOcclusion Update must be overridden by derived classes")

return desiredCameraCFrame, desiredCameraFocus

end

return BaseOcclusion

My fault, it’s actually inside Popper I’ll edit my post.

1 Like

https://www.roblox.com/library/4178002376/FIX-Camera-Transparency-above-0-2