- Home /
Windows Phone (Emulator) GUI.Button() is always true
I'm currently porting a game that works fine on Android and iOS to Windows Phone 8 (and inside the Unity Editor, of course). But when I build the game and run it on the Windows Phone 8 emulator from Visual Studio Express 2013 GUI.Button() will always return true without clicking/touching the button.
Sadly I'm not able to try the game out on an actual WP8 device (yet) so I don't know if the emulator is the problem or my code.
Has anyone had similar issues (presumably with the Windows Phone 8 Emulator)?
More Info: I have the following code in an Update() method to see if there is some kind of "phantom input" that could trigger the buttons, but there is none. Only the touches or clicks that I triggered myself.
foreach (Touch touch in Input.touches) {
Debug.Log (touch.fingerId + " touched(x,y): " + touch.position.x + "," + touch.position.y);
}
if (Input.GetMouseButtonDown (0)) {
Debug.Log ("Left-Mouse-Click at(x,y): " + Input.mousePosition.x + "," + Input.mousePosition.y);
}
BTW: I've searched for answers and stumbled upon the following questions. But sadly my problem seems to be of another kind: GUI.Button is always true? Gui button is always active?
Answer by steffenwittig · Jul 08, 2014 at 06:01 PM
The problem was Unity 4.5. I downgraded to Unity 4.3 and build the game again. This time everything worked as expected.
Your answer
![](https://koobas.hobune.stream/wayback/20220613153458im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Move GUI elements. 0 Answers
Using GUI and check what button was pressed 1 Answer
GUI Button Disappearing 1 Answer
I have doubt please help me 2 Answers
GUI.Button press (not click) 3 Answers