I’m trying desperately to get 2 game objects to act as buttons in an app menu but even with the reference material I have found I can’t seem to find or understand a simple touch the screen to press a button example. I know it is using raycasting.
One button it to load a level which is the main app
The other is weblink.
If anyone can help that would be fantastic.
Until then I will just write and test until I hopefully figure it out
if (Input.GetMouseButtonDown(0))
{
//empty RaycastHit object which raycast puts the hit details into
var hit : RaycastHit;
//ray shooting out of the camera from where the mouse is
var ray : Ray = cameraInterface.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, hit))
{
//check hit against name, tag, or however you are checking
}
}