So… both condition triggered at once? I hopes “Trigger once” help with it but maybe it dont. How do can I fix it? Sorry for bother but right now I don’t get it.
first of all you don’t use sub events for no reason, I don’t see any reason for most of your logic to have sub events . Better do this.
Condition: variable SwitchOn is > 1 ==> Action: do = 0 to variable SwitchOn
Condition: variable SwitchOn is < 0 ==> Action: do = 1 to variable SwitchOn (this second event is not necessary, but in case)
now this is the main event you want
Contidition: the cursor/touch is on new object ==> Action: do +1 to variable SwitchOn
Touch or left mouse button is down
Trigger once
yes that’s right add 1 to the variable switchon every time it clicks on the new object
Note: no need to tell the computer that the variable switchon is 1 or 0
Solution by Lizard-13 works great, but Umar’s solution very interesting too. Thanks a lot! Now I understand how to make this switch button and learn something about GDevelop logic.