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 Highlighting UI Button when the button is pressed

Discussion in 'UGUI & TextMesh Pro' started by frankiwinnie, May 8, 2024.

  1. frankiwinnie


    Dec 1, 2020
    Hello everyone,

    I have a button in my canvas with the button component having transaction mode in sprite swap. The "Highlighted Sprite" has a sprite added in the inspector tab.

    When the mouse is dragged on to the button, the highlight works correctly. However my question is when the button is pressed, if I try to repress the button second the time, when I hover the button the highlight sprite does not change anymore. If I press somewhere in canvas other than the button itself, the highlight sprite starts to change again. What I want to do is that the sprite changes when hovered even the button is pressed.

    Is it the case with the highlight, do I do something wrong? Any suggestions on that is much aprreciated.