Author Topic: OnMouseOver on mobile?  (Read 9892 times)

Chris_E

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 37
    • View Profile
OnMouseOver on mobile?
« on: July 05, 2012, 02:04:15 PM »
Hi,

I'm looking for something like an OnMouseEnter event for mobile.  I have a pickup, and when it's touched or when the finger slides through the object I want it to be picked up.  Is there any way to do that?  Also, along the same lines, I have something else that I want to have react in script to the same type of events; As long as the touch is inside, either by touching down or sliding inside (or, I guess, if the object moves inside of the touch area!) it has to respond.

Thanks,

Chris


Chris_E

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 37
    • View Profile
Re: OnMouseOver on mobile?
« Reply #1 on: July 05, 2012, 02:38:59 PM »
I am trying this which I modified from the Unity Wiki's OnTouchDown script:

http://pastebin.com/3xJKuTGj

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnMouseOver on mobile?
« Reply #2 on: July 05, 2012, 06:23:11 PM »
Hover events are not sent on mobile devices because there is no way to detect a finger hovering over something. You can work with OnPress() events instead.

Stephan

  • Guest
Re: OnMouseOver on mobile?
« Reply #3 on: July 16, 2012, 04:36:59 PM »
I am creating left and right buttons, I need to know when they drag off the collider.  OnHover would do the trick, is there anything similar for Touch?  I need to know if the user slides there finger over a control or off the control.