How do i use same buttons for two actions

so i was wondering can i implement two actions with one button,

e.g i know i can release button to get 2 different actions done with same button like changing colour of object with A ,when pressed to red .when released change colour to green…

i want this type of program, when i press once and release “A” ,colour of object turned into red, when i press it again it and release “A” it changes back to green or whatver …so repeat it ,on pressed and release !! hope you got my point

also i have hard time getting to know how its logic works…what is core of its logic can any body explain,

With BUTTONS I MEANS KEYS PRESSED

You’re going to need to set up a button that uses togglable states.

http://wiki.compilgames.net/doku.php/gdevelop5/tutorials/how-to-make-togglable-states-with-variables

The tutorial here goes over the general logic, as well.

3 Likes