How should I make the camera

This is mostly an API question. I want to put a visible part in front of the camera, and to not have it “push” the camera in. This is because we have pets in my game, and its a shooter.

The pets are usually unintrusive, shots go through them and stuff, but we recently added a Phoenix pet which is a bit bigger, and it sometimes goes in front of the camera if you play in third person, and this jarringly causes the camera to zoom right in.

I can’t find any API on the camera page, the best I came across was a hacky solution from Maelstronomer (https://devforum.roblox.com/t/how-do-i-make-the-camerascript-ignore-go-through-a-few-collidable-parts/48409), but its from 2013 and was wondering if we had any better solutions?

Thanks!

1 Like

Make it non collidable and use collision groups to make it collide with other stuff.

5 Likes

I was pretty sure there was a way of having the camera ignore pets. Parenting the pets ‘model’ would be one way, but looking in the CameraScript that the player has and see how it decides what will/won’t be counted as a collision. You can then make sure that no-ones pets can affect anyones camera.

1 Like

Edit the PopperCam module which is a child of CameraScript in StarterPlayerScripts.

What you could do, is tag all the pets with CollectionService
e.g.

game:GetService("CollectionService"):AddTag("Pet", "CamIgnore")

Then edit code in the PopperCam module to ignore any object with the tag you gave your pets…
Under “function PopperCam:Update(EnabledCamera)” edit the ignore list table to include the collection (line 132 on most recent version of module):

local ignoreList = game:GetService("CollectionService"):GetTagged("CamIgnore")
3 Likes

Thanks, this worked great!

This didn’t work for me.
Setting it to be non-collidable just caused it to fall through stuff, no matter what I did with collision groups.