I have a problem were I have a invisible door that goes into a room with a click-to-give uniform. The camera can go through the door, even with the group-only door script. I want the door to remain transparency 1 but make it so the camera can't go through it, any ideas? Door script I use is below on a transparency 1 part.
local rank = 47 -- The rank the player will need to get through (out of 255) local groupID = 4957909 -- The group ID the player must be in script.Parent.Touched:connect(function(hit) if (hit and hit.Parent and game.Players:FindFirstChild(hit.Parent.Name)) then if (game.Players[hit.Parent.Name]:IsInGroup(groupID) and game.Players[hit.Parent.Name]:GetRankInGroup(groupID) >= rank) then script.Parent.CanCollide = false script.Parent.Transparency = 1 wait(1) script.Parent.CanCollide = true script.Parent.Transparency = 1 else script.Parent.CanCollide = true end end end)
If you override the Popper script's
canOcclude function, you can tell it to occlude (have the camera not pass through) whatever you want. For instance, you could remove the part where it checks if the part's transparency is less than .25 or .95
See https://developer.roblox.com/articles/Movement-and-camera-controls for the basic idea of overriding scripts.
The Popper script is in PlayerScripts.PlayerModule.CameraModule.ZoomController.Popper
part.Transparency < 0.25 andand
part.Transparency < 0.95 andin the function that starts on line 124) OR have it check to see if it's the special door you're interested in, like:
local specialDoor = workspace.SpecialDoor local function canOcclude(part) -- Occluders must be: -- 1. Opaque -- 2. Interactable -- 3. Not in the same assembly as the subject if part == specialDoor then return true end 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
(In the above script, that's the default
canOcclude function, but I added the 2 lines that have 'specialDoor' in them.)
So if your gonna do this, make sure you duplicated the part, insert a normal mesh in it and set it's scale all to 0, and you're done. Use it on your main part as its easier.