title: Unity3D checking if a point is inside a game object
body: <p>I am trying to check in Unity if a point(x location of touch,y location of touch) is inside a game object created(Rectangle shaped), if yes, start and spin it around.</p>
  
  <p>I am pretty new to Unity but I tried doing it myself, here is what  </p>
  
  <pre><code>    Rigidbody rb;
      float x, y;
      MeshCollider col;
      Vector3 v;
      bool bo = true;
      // Use this for initialization
      void Start()
      {
          rb = GetComponent&lt;Rigidbody&gt;();
          col = rb.GetComponent&lt;MeshCollider&gt;();
      }
  void Update()
  {
      if (bo != true)
          rb.transform.Rotate(Vector3.back, Time.deltaTime * 200, Space.World);
      if (Input.touchCount == 1)
      {
          x = Input.GetTouch(0).position.x;
          y = Input.GetTouch(0).position.y;
          Debug.Log(x + "DOTS " + y);
          v = new Vector3(x, y, 0);
          if (col.bounds.Contains(v))
              bo = false;
      }
  
  }
  </code></pre>
  
  <p>My console is not showing anything, also if I type <code>Debug.Log("HELLO");</code> and I can't pretty much check myself so that is pretty much my code, appreciate any help.</p>