Hello, I’m trying to get a button to call a function while a button is being clicked. Where would I find information on this?
Towards the end they show hooking in a few different things into the onclick, one of which is a function call.
Is there something for holding down the button to continually call the function?
Not exactly.
You can detect when the user starts and stops pressing something if you replace your Button component with an EventTrigger component (or write your own behavior implementing IPointerDownHandler and IPointerUpHandler). You can use those events to set a variable somewhere that indicates whether the button is currently down, and then do something in an Update() function based on the current value of that variable.
1 Like
thank you this helped.