Script to hide object not seen by camera (occluded by other objects)


Hello everyone! I have been trying to find a way for this issue but cant figure it out, it might be something easy to do, basically if i have 3 objects or more in the scene in front of each other, I would like to turn the visibility off on the objects that the camera cant see (occluded by other objects). like the image below. if you guys can help me out it will super appreciated. python code is ideal.

At least if script can track just cone alone And turn visibilty off on it when its behind other objects from camera view, if it cant do it for all objects :slight_smile: