Camera moving though any parts with transparency

That’s a property that the glass material has, a trick many people use is instead of glass use SmoothPlastic, as it looks very similar to the Glass material, yet some reflectance properties change a little and it doesn’t have that glossy surface, but that’s as good as it gets

1 Like

Okay, I’ll try and test it in-game.

Its because you’re using glass. Use transparent plastic/smooth plastic instead. I have seen this issue in a few builds of my own. Hope this helps.

2 Likes

Yeah glass but I want to disallow from moving their camera through glass as because it looks like in real life they breaks glass to bypass.

Does the glass have can.collide on?

Yep, can collide on but it still allows their camera moving through there, the glass.

Thats odd. Try using transparent plastic?

1 Like

I fixed it by editing the Popper module script, first, you have to test the game, then go into game.Players > LocalPlayer > PlayerScripts > PlayerModule, then copy that module. once done, stop the play test and go into game.StarterPlayer > StarterPlayerScripts and paste the module that you copied before. now, if you open up PlayerModule > CameraModule > ZoomController > Popper and scroll down to line 124, you will see a function called canOcclude, delete the function, copy-paste the function below

Code
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 < 1 and
			part.CanCollide and
			subjectRoot ~= (part:GetRootPart() or part) and
			not part:IsA('TrussPart')
	else
		return
			part.Transparency < 1 and
			part.CanCollide and
			subjectRoot ~= (part:GetRootPart() or part)
	end
end

hope this helps

78 Likes

There we go, thanks for the help and it worked. :wink:

make sure to make the solution

What do you mean by making solution?

He means (Mark His Post As A Solution Only If Helped You With Your problem) if someone, gives you a solution to your problem and aids you into fixing it. Those who went out of their way to help you out with your! Issue by providing you with a helpful, explanation on how to fix or helps you, with your problem. The post has to be marked as a solution! That should be the one that is most useful to people, who have a similar problem. that as a solution. then responding with the fix and! Marking that as a solution. That’s actually helpful to anyone searching for similiar issues.

As well the (Solution) is on the right. Corner by the like button:

Here

Ok, done. Marked it, on solution.

2 Likes

Thanks for the solution, @sozzly
I wanted to have invisible colliders made from Parts to encapsulate my higher poly meshes that don’t have colliders and could prevent the camera from going through them this way.

Just reporting that the function looks different now, but works this way, with that one line changed I commented out after return:

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

	return
		--getTotalTransparency(part) < 0.25 and
		getTotalTransparency(part) <= 1 and
		part.CanCollide and
		subjectRoot ~= (part:GetRootPart() or part) and
		not part:IsA("TrussPart")
end

By the way, can this cause problems later?
By adding the PlayerModule/CameraModule and also PlayerModule/ControlModule to your game under StarterPlayerScripts it will use the current versions of those modules for ever.
What if Roblox improves something in those? How do you know when you have to update them again?

Isn’t there a simpler or more proper way to prevent the camera from going through invisible colliders?

5 Likes

This works great but for me I was using the popper script for something else and it didn’t work.

I instead replaced the getTotalTransparency(part) > 0.25 on line 128 with getTotalTransparency(part) < 0 and it also worked.

How to mkae it work for cancollide parts?

This doesn’t work for me, the camera can still go through the transparent plastic


Sorry for the bump, but it underlines something in the script. It’s too long to spell out lol.

It says “unknown global (long name)”

Thanks.

Yeah, the script was updated quite a while ago, try this instead:

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

	return
		getTotalTransparency(part) < 1 and
		part.CanCollide and
		subjectRoot ~= (part:GetRootPart() or part) and
		not part:IsA("TrussPart")
end

It’s not recommended to fork the PlayerModule, but honestly, I don’t see a better way.

1 Like

Why not? I’m just curios :face_with_monocle: