Pressing a Button

How to make the application perform a procedure while I am pressing a button.
For example, I want to make a character walk on cansas while I’m holding the floor button.

PS: REMEMBERING THAT THE BUTTON IS NOT INSIDE CANSAS.

You can use a clock. It should start disabled.

When the TouchDown event is triggered, save what button is touched inside a global variable and start the clock. Inside the clock Timer event check what button was touched (with the global variable) and do what it’s supposed to happen while that button is pressed.

When the TouchUp even is triggered, set the clock timer to disabled.

left_right.aia (2.4 KB)

3 Likes

I’m sorry for my stupidity.
I really thought of TouchDown and TouchUpera when we click on a button and drag it up or down. Thank you so much for clarifying my mind!

1 Like

The trick is those combined with a clock.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.