Having trouble understanding timers and buttons

Hi I am new to Gdevelop. I am trying to make a simple animation. When the player presses a button (mobile game) I want to gradually increase the opacity of an object to 255.

I cannot find how to do that. I did it with the cursor/touch is on object but that means that the player must keep pressing the button to finish the animation.

How timers work? Do they start count from 0 and up every 1 second? I cant seem to make them work in my project.

When you reset a timer, it begins to synchronise it’s value with the time since you reseted it. For example in your case you could do “When button pressed reset timer oof” and “when timers oof’s time > than 0.3 then add 1 to opacity of object and reset timer oof”

Wiki page about timers.

Wiki doesnt help me that much. If anyone has the time to put a text on a project and countdown from 10 to zero that would be so helpful.

you don’t need a real timer create a countdown. but 10 what? minutes? seconds? or its just a value of a variable?
does accuracy matter?

I figure it out with the help of a youtube tutorial that spawns objects every 1 sec at random positions.

1 Like