D
D
Daniel23102021-06-27 10:51:10
C++ / C#
Daniel2310, 2021-06-27 10:51:10

Is it possible to track the click and hold of a ButtonUI button in Unity?

Hello, is it possible to track when a Button is pressed down without triggering Onclick() ?
For example: I hold down the button, the variable istrue = true and so that when I release the button, Onclick () does not work. And vice versa, so that when the button is pressed, the clamping function does not work (istrue = true).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bundllor, 2021-06-28
@Bundllor

You can add an Event trigger component to the button, then select the pointer up and pointer down events in this component, then bind functions to them to change istrue.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question