Unity UI - Button tap vs hold.

I’m trying to have two different functions based on if a button is tapped, or held down.

If the button is held down for more than .75 seconds, method A() will be called, however if it’s released before .75 seconds method B() should be called. How can I go about doing this?

This can be done with event triggers. Add the ‘Event Triggger’ to your button object.

Then add ‘Pointer Down’ and ‘Pointer Up’ events selecting ‘Add new event type’.

Then you can hook up the Pointer down with a function that is essentially a timer.

And hook another function for the pointer up event.

This function on the pointer up event will eventually check how much time has passed in the timer, and do what you intend to do with it.

Timers can be created using the ‘Time.deltaTime’ property. Here is one that I found :

How Can I make a Timer With The New UI System? - Unity Answers