- Home /
Remote Gui Button only works on device if mouse is over the button in Unity editor
I am using Unity 4.2.0f4 on Windows 7 PC.
I have my Samsung Galaxy Note 10.1 attached with USB and the Remote app. This appears to working correctly as I added a first person controller from the mobile assets and it moves around with touches inside the dotted corners.
I am now trying to add a simple button to my window.
This didn't appear to work at all when tapped on the Galaxy Note. If I clicked on the button in the Unity Game window in the Unity 4.2 Program on my PC it did work as expected.
And then I noticed that if I left my mouse over the button in the Game window, the Galaxy Note would now detect the touch on the button.
Is this a bug, or am I doing something wrong ?
I searched the forums and found only this similar question : http://answers.unity3d.com/questions/543284/unity-remote-detecting-touches-only-at-mouse-posit.html
Any help gratefully received as at the moment I cannot test buttons using Remote on my Galaxy Note.
The code I used to test was (taken from the forums) :
var Nnn = "TextA"; //Text variable for change text
function OnGUI ()
{
if (GUI.Button(Rect(10,10,50,50),GUIContent(Nnn))) //Create button with text variable
{
print("Text to confirm in log");//Just text in log
Nnn="TextB";//Change what must appear in button
UpdateMessage();//Do the function to change text
}
}
function UpdateMessage ()//Function to change text
{
UnityEngine.GUI.Button(new Rect(10, 10, 50, 50), GUIContent(Nnn)); //Lust change the text in GUI.Button
}
Tried the above with my Galaxy S4 attached with the Remote and experienced the same. Can only trigger the button if the mouse is over it in the main Unity Game window.
Has nobody experienced this before ?
I'll build the project and test it on my devices to see if it is a Remote glitch.
D.
Having the same problem here on a galaxy $$anonymous$$i 2, pretty sure I didn't have this with 4.0, just recently upgraded to 4.2 and now it is doing this. builds seem fine, but testing stuff has become very annoying now.
First time using Unity Remote with Unity 4.3.2 and experiencing the same problem on my nexus 5 running Android 4.2.2. From SomeRandomGuy's comment sounds like a bug may have been introduced in Unity?
same problem with galaxy note 10" and asus transformer pad tf300t. any ideas?