Make object invisible when camera is not seeing it

How do i Make a object invisible when camera is not seeing it?
I thought that it might prevent some lag.

Your object outside of Camera’s frustrum automatically get culled (frustrum culling), i.e. not rendered (please note, if any part of mech will be in frustrum - whole mech will be processed).

But if you wish to perform any specific actions when your object (with Renderer component) is get in / out from frustrum, I’d suggest to try OnBecameInvisible and OnBecameVisible first.