- Home /
Question by
Tiberius1701 · Sep 15, 2014 at 07:49 PM ·
uiiosmacipad
Test for over UI 4.6 works on Mac doesn't work on iPad
I have created a small script that tests for whether the mouse is over a UI element, and returns that state. I then use this to determine whether to raycast.
It works properly on the Mac, but when testing on the iPad, it doesn't.
Any idea what I might be doing wrong?
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
public class touchTest : MonoBehaviour {
public int overUI = 0;
public int ReturnUIState (){
return overUI;
}
void Update () {
if (EventSystemManager.currentSystem.IsPointerOverEventSystemObject ()) {
// we're over a UI element...
overUI = 1;
}
else{
overUI = 0;
}
}
}
Thank you!
Comment
Your answer
Follow this Question
Related Questions
Codes / Scripts that will not work on iOS 1 Answer
A node in a childnode? 1 Answer
Unity Ipad app will not run on device. 1 Answer
UI button behaves wrong on iPad 0 Answers