Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question IPointerUpHandler not working with touch

Discussion in 'Scripting' started by kloot, May 15, 2024.

  1. kloot

    kloot

    Joined:
    Mar 14, 2018
    Posts:
    79
    I'm trying to run some code when the user lifts his finger from a button during touch.

    I tried implementing IPointerUpHandler, but for touch, OnPointerUp only gets called if the touch was started on the button... I need it to fire also when the finger started touching somewhere else and was then released on the button.

    I can't use the click even of the button since that also doesn't fire unless the finger was over the button once the touch was made...

    I feel I tried everything - any ideas would be appreciated.
    Thanks
     
  2. grapemane

    grapemane

    Joined:
    Dec 1, 2020
    Posts:
    4
    I have a really similar issue - I want players to be able to hold down a button and be able to move their finger around within the button without the button being released. Works find with a computer cursor, in mobile it just falls apart :C