Camera rendering help.

I’m not sure if this is possible without pro for maybe some kind of camera effect, but I want it where I can see through the camera at a far distance but I can only see certain layers at closer distances for better fps. For example if I wanted to make it where a certain layer could be seen so far and then a different layer be seen at a different distance So I choose the layer and higher or lower the float value for the distance rendering. I know it has to be done through a script, but I only know some basic stuff. Can somebody please help me? And if you guys can provide me with a script on how to do this than can you guys put like five different layer variables, that way I can choose how many different things I can see. Please help me I really need this.

You’ll want to use the cullingMask variable of the camera and adjust it to include certain layers depending on their distance from the camera, which you can calculate through the distance formula where you can compare the position of the camera and some position variable that represents where the layer is. I’d run this calculation for all layers in a Coroutine that runs every few seconds or so since doing it every frame is kind of overkill.

If point to point distance doesn’t work for you, you might want to look up distance between a point and a plane which would probably work better for this case.

If you need me to write up an example I can but I recommend you try it out yourself first.