I want to select an object and have the camera zoom in but inactive the other objects. I am having problems

This is a follow up to this question: How can I select, single out and zoom into my object? - Unity Answers

For more complex objects and scenes, I tried to assign the script to my main camera. However, my objects disappeared including what was supposed to be zoomed in and rendered. If I play the scene for game view and then pause the view, it appears that the piece that was supposed to be isolated and zoomed into is shown (the only object shown out of the whole structure) but for some reason, it does not render in game view. It only shows up when I pause the view.

Why is that?

As a guess, the issue is the size of the object. The code zooms by moving the camera forward. If the object is large, then moving the camera in puts the surface of the object beyond the near clip plane of the camera. Result: the object disappears. Edit line 23:

camPos.z += 5.0; // Zoom

Select a smaller number than 5.0. Note this may not be the complete or right fix for your game. There are a couple of other things you can do. The first is in your initial setup, move the camera back away from object and then narrow the field of view of the camera. This will give you more working room for your zoom while maintaining the same object size. You can then edit the ‘5.0’ in the line above as appropriate.

The second thing that can be done is to recode the zoom so that it change the field of view rather than moves the camera. Given the camera was already going to move sideways to center the object, moving it forward was the simplest solution.