Would this increase performance?

So let’s say you have a script on every object in the scene and the script checks if the object is within a certain range of the camera and if it’s too far away it get’s switched to a layer that is ignored by the camera, but if it is in range it switches to a layer that isn’t ignored by the camera. Would this be good or bad for performance? Would it slow down the game even more because it has a script checking everything constantly in the game, or would it be better. What if it sent a function rather than an Update function on every gameObject. Tell me if I’m being to unclear.

The complexity of that is linear, the more object you have, the more calculation. You should use physic, with a sphere collider on the camera, set to trigger, switch to visible everything that comes in (OnTriggerEnter), and switch off everything that comes out(OnTriggerExit).

You might need to improve that with layers so not everything is concerned, and you also need to initiate properly if, at Start, objects are already inside the trigger.

It would be bad, because Unity already does that without you having to do anything. Anything outside the camera frustum is not rendered.