Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to deal with UI sticky hover effect on touch screens ?

Discussion in 'Scripting' started by Avalion, Nov 25, 2016.

  1. Avalion

    Avalion

    Joined:
    May 2, 2012
    Posts:
    34
    Hello all !

    I'm wondering if someone found a way to deal with the sticky hover effects over the UI elements.

    I have a scene with toggles. Whenever a toggle is hovered at the end of a drag and drop touch, its state switches to "hover" and stay in this state despite of there is no touch on the screen. This effect is pretty annoying in our game as the "hover" effect is really similar to the "selected" one.

    Another annoying issue is clicking on a UI item is pretty hard as Unity consider too fast the touch as a drag and drop action, that will not call the onClick function of a Button or the onValueChanged of a Toggle.

    I already tested things as "EventSystem.current.SetCurrentSelectedGameObject(null)" but it did not work and my toggles already have "Navigation" set to "None".

    Any help or advice would be really appreciated.

    Is there any way to edit this behavior, in order to clean the app mouse hover when there is no touch on screen on a mobile device ?

    Thanks in advance.
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. Avalion

    Avalion

    Joined:
    May 2, 2012
    Posts:
    34
    Ok, I created a new thread onto this part of the forum. thanks for this advice.
     
  4. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,739
    When dealing with touch hover is useless, simply make the hover state look the same as the default state