4.6 uGUI Mobile - Touch Button not working.

I have a button that starts the game. In the editor it works fine – click it changes color and starts the game (loads new scene).

On mobile it changes color when selected/clicked but stays in the “Active” color, without calling the function it’s supposed to call.

Any ideas why this may be happening?

I’ve also done it with an event for “pointer click”, same deal – works fine in the editor (gets two debug logs for the function, since both on click and event pointer click are working), but not at all via touch.

UPDATE: If i touch the button repeatedly it seems to eventually work. After maybe 5 seconds of tapping.

SIde note: It seems possible to select 2 or 3 buttons at once. (yellow is my “is pressed” color, and all three buttons were able to turn yellow at once if I spammed them with my fingers)

1 Like

We have some bugs on the touch input module that we need to investigate.

2 Likes

K, Cool. The actual game scene which has buttons being held down for moving/shooting works fine it seems.

I am facing the same issue, I hope that this will be fixed in released update.

All the issues I had above have been fixed in b19. b20 is out now, so there shouldn’t be these same issues anymore.

I have just experienced the exact same behaviour mentioned above but in RC2. Booh. Same deal. I can get the button to work by tapping on it with very quick short taps eventually. But it’s mega janky.

Yeah same problem here in RC2.
I’m using animations to control the menu’s and works fine on Editor, but can’t get any response from the mobile.

Hmmm, on further testing, the button OnClick() is working on the mobile, but animations aren’t playing.
Again, the animations work in the Editor, but not on the mobile.

It’s all working fine in RC3!

Thanks guys :slight_smile:

[EDIT] It’s broke again. See below :frowning:

Nah. Just built in RC3 and all the touch stuff if totally messed up on my iPod including buttons, scroll rect and scroll bar.

I don’t know if it is related but I had some issues trying to figure why some of my buttons were not taking a ONClick. After trial and error I found two scroll bar Handles on unrelated UI gameobjects that had NaN as the top and bottom values. If Disabled that scrollBar handle then my buttons are pressable. If I re-enable the handle then they are not.

On one scroll bar I was able to reset the value from Nan to -10 which seems to be the default but on the other handle it will not let me over ride it so there must be something else int the layout that is causing this behavior.

I am not sure if I should open a bug a I might just have something misconfigured but I am not sure what that could be.

iByte

Hmmm, I made some big changes to my uGUI and now the animations stopped working agian on the mobile :frowning:
Sigh… They say RC3 will be the final release. I’m worried!

OK, So I Installed KGFDebug because I noticed slight delay when I press the button on the mobile. I had a feeling there was a Null Reference going on there somewhere and sure as eggs, here’s the screenshot from my mobile.
Again, this works in Editor :rage:

OK, I nutted out where the error is…
For some reason the OnClick() section to my script won’t accept objects.
I can pass int and string fine, but any objects (I tried Animator and GameObject) seems to cause the Null Reference error.
I can work around it, but it’s kind of annoying.

Cheers :confused:

Do you have any OnClick() events pointing to scripts that pass objects?
If so this may be the cause of your problems too. See my post above.
Good luck :slight_smile:

I have a similar issue on Android with RC3.
If I hold my finger on the button for half a second it works, but if I tap faster, it behave more like a ‘hover’

I’ll give this a look when I get the chance. I really hope it’s something I can fix on my end since the 4.6 release is right around the corner!

Same problem here. The passing of objects gives me null reference exceptions. It worked fine before (b18 I think), but after the update to 4.6.1 my whole menu structure stopped working, because I pass them as objects >.<

I have the same problem with the latest Unity3d 4.6 Version (4.6.1p3). The default OnClick event of a button does not work at all for mobile devices (android and iOS), but it works in the editor. If i tab on a button on a mobile device, is see only the pressed or hover animation, but no click event is raised. I can raise a click event, when I am tapping repeatedly very fast on a button for about 5 seconds or so.

Is a bugfix in the works or should I use the PointerDown and PointerUp events to handle a click?

we’d need to know about the bug to have a bugfix in the works. Could you file a report.