Render.isVisible help

I created a script which is turned on after an object is set active. When the object is set active you have a certain amount of time to find and look at the object or it will attack you. If you are able to look at the object in the given time, the script is disabled and another one is enabled to set the object active. I used a if(GetComponenet().isVisible) and added a debug logs to see if it works.

{

    public MonoBehaviour othercomponent;
    private bool shown;
    RaycastHit hit;
    public float thedistance;
    public int speed;
    Coroutine co;

    // Use this for initialization
    void Start() {
        StartCoroutine(Startt());
        co = StartCoroutine(Startt());
    }

    IEnumerator Startt()
    {
        Showing();
        shown = true;
        yield return new WaitForSeconds(speed);
        shown = false;
        Attacking();
    }

    IEnumerator Startt2()
    {
        yield return new WaitForSeconds(speed);
        othercomponent.enabled = true;
        GetComponent<Shown>().enabled = false;
    }

    // Update is called once per frame
    void Showing()
    { 


        Debug.Log("Shown");
        if (GetComponent<Renderer>().isVisible)
        {
            Debug.Log("Visible");
            thedistance = hit.distance;
            StartCoroutine(Startt2());
            StopCoroutine(co);
        }
    }

    void Attacking()
    {
        if (shown == false)
        {
            Debug.Log("Attacck");
        }
    }

    void Update()
    {
     
    }


}

The Problem is that the object does not become visible even when both scene and game view are looking at it. Am I using the isVisible wrong?

You should use these to check whether an object is visible to a camera or not

		private void OnBecameVisible()
		{
			// your code here
		}

		private void OnBecameInvisible()
		{
			// your code here
		}