Author Topic: Not getting a down state with Touch  (Read 5491 times)

g0vi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Not getting a down state with Touch
« on: April 02, 2014, 06:09:31 PM »
Hello!

I came across several topics in these forums about using touch, but nothing quite relating to my issue. My problem is simple enough, when I "tap" a sprite (with "UIButton" and the collider attached) the color does not change nor does it switch sprites for the appropriate states(hover, pressed). It works when I click but not when I use touch "tap". However when I tap, I still am able to do all the specified tasks in my OnPress() or OnClick() methods.

Any ideas ?

Thank you

Joe

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Not getting a down state with Touch
« Reply #1 on: April 02, 2014, 06:14:25 PM »
There is no "hover" state with touch-based input. You only get OnPress and OnClick.

g0vi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Not getting a down state with Touch
« Reply #2 on: April 02, 2014, 07:46:56 PM »
Yeah that's true, but still I am not seeing a pressed(normal -> pressed) state in which the color or sprite changes. Only with mouse does it happen.

Thank You for getting back to me!

Joe

g0vi

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Not getting a down state with Touch
« Reply #3 on: April 03, 2014, 09:21:15 AM »
I made this short video to demonstrate my issue:

https://www.youtube.com/watch?v=8RsJxKqM1yU&feature=youtu.be


nkls

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Not getting a down state with Touch
« Reply #4 on: April 03, 2014, 11:40:13 AM »
I have the same problem on my touch screen (AG Neovo TXW 42).
Would be very happy if anyone finds a solution!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Not getting a down state with Touch
« Reply #5 on: April 03, 2014, 09:31:40 PM »
Hmm... maybe it's something touchscreen-specific? Try turning off mouse input on the UICamera. Does it work then? I'm guessing Unity reports events twice from a single touch, resulting in both mouse and touch events from a single action which breaks things.