- Home /
Question by
X-devGames · Jun 06, 2013 at 09:02 AM ·
androidscreenteleporting
How to detect whether a portion of the screen is touched
Hey, i am developing a game for android and it involves shooting a raycast and teleporting where it hits when the screen is touched but when i touch the move area to walk forward it teleports me, i want to know how to only teleport when the top part of the screen is touched.
Comment
Best Answer
Answer by moha · Jun 06, 2013 at 09:35 AM
you can define a new Rect for the top of your screen and test if the position of the touch is contain or not in the rect. http://docs.unity3d.com/Documentation/ScriptReference/Rect.Contains.html