- Home /
How can I change the state of a button to "Normal"
I have a UI Button where I need to change the button state from "Pressed" to "Normal" from a script. Is this possible? Please note that it is NOT about changing selected, highlighted or interactable state, it's about the specific transition from "Pressed" to "Normal".
The situation is this: The button has dual functionality: If I click the button, a popup should be displayed but if i press and hold for a second, then a default value should be used (instead of a value selected in the popup). The main issue here is that I want the button to perform the "Pressed" => "Normal" transition when this happens even though the button is still pressed.
The button has color tint transitions that works as expected both from "Normal" to "Pressed" and from "Pressed" to "Normal". In the click situation these transitions works as expected, but in the long-press situation nothing really happens with the button color since the button is not released yet.
So...in order to trigger a "Pressed" => "Normal" transition (in the long-press scenario) , can I in any way force the button to "Normal" state from my script even though the button is still pressed? I have all the code to handle the long press and I know exactly where to put the code to force the button into the "Normal" state, I just don't know how to do it.
Your answer
Follow this Question
Related Questions
How to make the button respond to touch and hold feature? 5 Answers
Move through selected buttons one by one 0 Answers
How do I reset a UI Button's color to it's 'normal' state. 0 Answers
How To Get UI Button To Stay In A Pressed State 1 Answer
How to Change Menu Button Rollover States with GameObjects 1 Answer