Increase render distance for one object only

I would like to increase the render distance of one specific object. I need to be able to see the object from very far away, but I cant have other objects render from that far. I need a script to put on the object, not the camera. I have no clue how to script (Im trying to learn) Thanks for the help. If I need to be more specific then just tell me. (this is my first question) Thanks again!

Seems like there must be a “correct” way to do this. But this would probably work:

Make a 2nd camera with a crazy big view distance, which only shows that object.

Specifically (and this is elsewhere under 2nd cam tricks): make a new layer, maybe FAR_SHOW. Set the object to that layer. Set the main cam’s mask to skip that layer, and the 2nd cam to only show that layer. Child cam2 to the main cam (so always exact spot.) Cam#2 depth to 1 (so it draws after cam2) and clearflags to none (unless you want far-thing to show through, then use depth.)

Not as wasteful as you think. But camera’s only key off of layers, so won’t work if you need far-thing on a layer for physics or whatnot.

The simplest way would be to add a script to your camera to use layer distance culling.

Set the camera far clip plane to the maximum needed distance.

Then use layer distance culling to set individual distances for layers, with a ‘far’ layer for your distant object using the camera’s maximum clip distance and reducing distance for all the other layers. For example, you could have a ‘detail’ layer for small objects that only renders up to 50 meters away.

This approach is more flexible than using multiple cameras, and probably more economical.

public class LayerDistanceCulling : MonoBehaviour {

    private Camera cam;
    public float[] distances; 

    void Start()
    {
        cam = GetComponent<Camera>();
        cam.layerCullDistances = distances;
    }

}