Hi, I am really new to unity iPhone and coding in general, and lately I have been having trouble making GUI controls. I want to make a character move by four arrow keys on the screen of the iPhone. I have tried some touch detectores on the iPhone screen before but the problem is, when you touch an arrow you can’t touch the another at the same time (you have to touch one at a time or it cancels the action of the second touched one). Any help would be greatly appreciated. Thanks
Hi, welcome to the forum!
As you say, the GUI system can only handle a single touch at a time. However, you can define rectangles on screen using the Rect class and check if a touch is within the rectangle using Rect.Contains. The separate touches on the screen can be retrieved using the Input.touches array (the manual page has a code sample showing how to use the touch data).
Thank you very much for responding! However, I dont really get how touch inputs work with unity, so could you write me a guideline of how it should look or something like that. Thanks again for the help!
Okay actually I got the Rect.Contains method to work but I have been using through a Input.GetMouseButton. So Is there a way to have multiple mouse clicks?
never mind i got it