- Home /
EventSystem.current.IsPointerOverGameObject Issues with Mobile
Hey everyone,
I've just encountered an issue that I've tried to solve for quite a long time now I still haven't found a solution. It appears that EventSystem.current.IsPointerOverGameObject always returns false when I test it on my iPhone. I use the following script that is attached to an orbit point gameobject which has the camera attached to it and rotates around the player when the user swipes. I've tried everything but I can't get it to work. Any ideas? Thanks in advance!
for (int i = 0; i < Input.touches.Length; i++) {
Touch t = Input.touches [i];
if (!EventSystem.current.IsPointerOverGameObject (i)) {
if (t.phase == TouchPhase.Moved || Input.GetMouseButton (0)) {
transform.Rotate (Input.GetAxisRaw ("Mouse Y") * sensitivity,Input.GetAxisRaw ("Mouse X") * sensitivity, 0, Space.World);
}
}
Your answer
Follow this Question
Related Questions
Insane EventSystem.Update lag spike, no graphic raycasters in scene 3 Answers
IsPointerOverGameObject bugs in 5.3 and newer. Workaround suggestions? 0 Answers
EventSystem.IsPointerOverGameObject doesn't work on virtual joystick (mobile) 0 Answers
UI does not show up (mobile) 1 Answer
Buttons stopped working after I temporarily changed the font. 1 Answer