Is there a way to get the Camera to ignore collision with specific parts?

It already was parented to the player (not in the video) but i have noticed some weird issues occuring whenever the model was parented to the plane.

For the purposes of a vehicle or an aircraft, an easy trick is setting the players maximum zoom distance to the same value as the players minimum zoom distance, which will prevent the players camera POV from colliding with parts blocking the path between the CameraSubject and the current position of the camera.

And then once you exit the vehicle, just undo the changes.

1 Like

But there are some parts which the player is not allowed to look through.

Try this, it should do the stuff you said just fine.

Keep in mind, the parts will be cloned, and might cause slight lag.

1 Like

I cant use it since there could be parts from 1 to 20000 in total which have to be cloned and it would create a huge amount of lag.

Have you thought about changing the Camera Type? You could set it to Attach which keeps the camera position at a offset position. You can put the offset position just above the plane towards the back of it.
Or, you could use CollectionService to ignore certain parts on your camera. It looks like from those GIFs that it could be the distance which allows your camera to collide with parts far away.

Could you explain this issue?

https://i.gyazo.com/2958a63679345ef60ed961401bda8627.gif

I think your hope may be just to use :GetLargestCutOffDistance

No, you’ll have to manually code this behaviour yourself. I would’ve suggested the PhysicsService but that would also affect physical collision, not just camera collision.

1 Like

In Poppercam_Classic script on line 79 there is an ignore list. I have forked this straight out of my game and had found this on the forums at the time to prevent players heads from glitching out this same way. There is probably some way for you to add your bricks into this ignore list?

		local ignoreList = {} 
		for _, characterplayer in next, game.Players:GetPlayers() do
			if characterplayer.Character and characterplayer.Character.Parent then
				ignoreList[#ignoreList + 1] = characterplayer.Character
			end
		end
2 Likes

Would this cause the camera to never get blocked off by the parts? Isn’t poppercam just for a short time period?

Correct, I don’t understand your second sentence on if its a short time period?

After looking through Roblox’s poppercam scripts (the part of the camera script that’s in control of what you’re trying to avoid), I noticed there’s no external way of adding parts to an ignore list. So here’s my suggestion:

I’ve modified the popper script in the camera script to accept anything with a “IgnoreCamera” tag from CollectionService to be included in the blacklist. You can find it under
game.StarterPlayer.StarterPlayerScripts.PlayerModule.CameraModule.ZoomController.Popper

Either copy the whole module and put it under starter character, or just replace the popper module since that’s the only module I changed.

Basically you can just do

game:GetService("CollectionService"):AddTag(partForCameraToIgnore,"IgnoreCamera")

and it should ignore being popped by the module.
PopperWithIgnoreList.rbxl (125.5 KB)

EDIT: Fixed an issue where it wasn’t handling removed tags from instances properly.

41 Likes

The place you sent is not working.

It’s working for me even after I redownloaded the place. Try clipping your camera through the Baseplate.

Oh wow i was looking in a hurry, Its working lol.

1 Like

How to remove this tag? I tried game:GetService("CollectionService"):RemoveTag(partForCameraToIgnore,"IgnoreCamera") but it doesn’t seem to work

Do the tags automatically remove whenever the part is destroyed?

Yes, any instance that had a tag that gets destroyed loses its tags. You don’t have to worry about collecting garbage with that since it’s done for you.