Camera moving though any parts with transparency

Hello,

I need help with this. http://prntscr.com/ovba39 I would like to make not moveable with their camera through the transparency parts.

Non transparency parts: http://prntscr.com/ovbbmy

That’s what I mean, how do I do that to make transparency parts the way to stop from people moving their camera trough transparency and as well even invisible part of Transparency 1?

23 Likes

You can control the amount of distance a player can zoom out, thats probably the easiest and most likely the only way to do it.

3 Likes

Hmm, how and where do I do that?

You enter studio, and check under Starterplayer, and in that you will see camera options and you can change the zoom variables.

1 Like

Nothing show here. http://prntscr.com/ovc8y1

1 Like

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