How to detect if a game object is visible by a certain camera

I want the player to hold a button and it completes a progress bar while holding and when the progressbar is complete the camera will scan and ping certain gameobjects within it’s view, I want to detect certain gameobjects with specific tag to be detected, i want to detect the object only if it is visible in view for e.x: if a wall is in front of the gameobject, It shouldn’t get detected, I have already implemented the hold button to complete progress bar mechanism, I just don’t know how to implement the detection part,I want the player to hold a button and it completes a progress bar while holding and when the progressbar is complete the camera will scan and ping certain gameobjects within it’s view, I want to detect certain gameobjects with specific tag to be detected, i want to detect the object only if it is visible in view for e.x: if a wall is in front of the gameobject, It shouldn’t get detected, I have already implemented the hold button to complete progress bar, I just don’t know how to implement the detection part

Hello there. You can use the built-in “OnBecameVisible” function:

void OnBecameVisible()
{
    //Do something
}

The target game object should have a script on it containing this function.