I am working with a main menu for a game. I have added some 3D Texts to use them as button and i have assigned the following script to Main Camera:
void Update () {
foreach (Touch touch in Input.touches) {
if (touch.phase == TouchPhase.Began) {
Ray ray = Camera.main.ScreenPointToRay(touch.position);
RaycastHit hit ;
if (Physics.Raycast (ray, out hit)) {
Debug.Log("HIT HIT FOUND");
if(hit.transform.name == "Option_Start"){
Application.LoadLevel("RedCubeScene");
}
if(hit.transform.name == "Option_Exit"){
Application.Quit();
}
}
}
}
}
However, always I click one of the texts nothing happens. Log dont show anything.
Any idea what could happen??
(I am using an Android phone)