I am making a game project, and in that game project I need to make a timer that starts when touch a object and stops when I stop touching that object, and have no idea how to do it.
Just need to add this condition and action:
Is Touching Sprite => add dt to timer
+ Add Touch plugin
+ timer is a global variable
+ dt is an expression in construct
Then you want to display it, add a text object:
Set text for text object = timer
Hi, thanks for the help, but I phrased it in the wrong way, I need help because I want to make so that when the character comes in contact with a certain object a timer starts, and when the caracter is no longer in contact with the object, the timer stops.
Develop games in your browser. Powerful, performant & highly capable.
So you can replace on touch with on collision.
Then you set a boolean equal true.
When the boolean is true, start to add up the timer.
In parallel, you count down X secs after non-interact, count to 0 the boolean back to false and the timer will stop.