Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UGUI Button(Selectable) Press state still stayed when pointer exits in unity2019

Discussion in 'UGUI & TextMesh Pro' started by xodennisxo, Mar 25, 2020.

  1. xodennisxo

    xodennisxo

    Joined:
    Mar 25, 2020
    Posts:
    24
    In Unity 2019, when you press the UGUI Button, hold and move out of it(PointerExit), the state will not change back to Normal but still stay in Press. This behavior is different with older Unity version(e.g 2018).

    After checking the source code, 2019 removed isPointerInside param check in IsPressed() function in Selectable.cs. I'd like to ask this is made by intension or a bug, i think many game want to keep the familiar behavior that when you drag out of a button, the button transit back to normal state.(e.g change back from press shrink size to normal size)

    2018:
    upload_2020-3-25_12-2-29.png

    2019:
    upload_2020-3-25_12-2-46.png

    Regards,
    Han Xu