Hello!
I am working on a game for tablets and am trying to make good use out of the touch screen. Right now the goal is to touch the model and make it sneeze. I have succeeded in getting the scripts for this to work but it works if you touch anywhere on the screen. This wouldn’t be such a problem except I have a GUI menu that needs to be touchable as well, and right now my scripts for the animation&audio have overridden the GUI. Is there a way to make the character model a touch trigger, so that the rest of the screen doesn’t react with a touch?
Here’s my current code:
{
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
animation.Play("sneeze");
}
I have played around with adding Touch.position (doesn’t recognize it); I have played with adding var Char : GameObject and different variations of Char.TouchPhase.Began, Char = TouchPhase.Began, etc. I have looked at the forums but I haven’t seen this problem presented quite this way… I would appreciate some help!