title: Checking if a Touch point is inside box collider in Unity
body: <p>Please see the below images.</p>
  
  <p><img src="https://i.stack.imgur.com/qsrlU.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/qDNr1.png" alt="enter image description here"></p>
  
  <p>In the first image you can see that there is box collider.
  The second image is when I run the code on Android device</p>
  
  <p>Here is the code which is attached to Play Game (its a 3D Text)</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class PlayButton : MonoBehaviour {   
  
      public string levelToLoad;
      public AudioClip soundhover ;
      public AudioClip beep;
      public bool QuitButton;
      public Transform mButton;
      BoxCollider boxCollider;
  
      void Start () {
          boxCollider = mButton.collider as  BoxCollider;
      }
  
      void Update () {
  
          foreach (Touch touch in Input.touches) {
  
              if (touch.phase == TouchPhase.Began) {
  
                  if (boxCollider.bounds.Contains (touch.position)) {
                      Application.LoadLevel (levelToLoad);
                  }
              }                
          }
      }
  }
  </code></pre>
  
  <p>I want to see if touch point is inside the collider or not. I want to do this because right now if I click any where on the scene 
      Application.LoadLevel(levelToLoad); is called. </p>
  
  <p>I want it to be called if I click on PLAY GAME text only. Can any one help me with this piece of code or can give me another solution to my problem??</p>
  
  <hr>
  
  <p>Recent Code by following Heisenbug's Logic</p>
  
  <pre><code>void Update () {
  
  foreach( Touch touch in Input.touches ) {
  
      if( touch.phase == TouchPhase.Began ) {
  
          Ray ray = camera.ScreenPointToRay(new Vector3(touch.position.x, touch.position.y, 0));
          RaycastHit hit;
  
          if (Physics.Raycast(ray, out hit, Mathf.Infinity, 10)) {
              Application.LoadLevel(levelToLoad);             
          }           
      }   
  }
  }
  </code></pre>