So, I’m trying to have the value of a global variable be increased or decreased in accordance with keyboard input. I’ve set the variable to be increased by 10 when the S key is released and decreased by 10 when the W is released. However, GDevelop only seems to register any key being released once and then it never registers it again. If I launch the scene with the debugger I can clearly see the variable decrease from 100 (its default value) to 90 when S is pressed, but then I can press S over and over again until the cows come home and nothing happens. Am I doing something wrong?
Exactly the same way you do it there. In the debugger (and yes, I know I have to press “refresh” in the debugger to get the new values if that’s what you’re wondering). It works once, but then it’s never accepting any input again. I will try it in an empty project though and see if I can get it to work as well.
EDIT: I tried replicating it in an empty project and now nothing works, not even once. Guess I’ll be reinstalling GDevelop then.
Typically, the pressed event is used to handle pressing, and a Trigger once while true is added to fire once. You are using the released event, which means that the event will fire when the button is released and it only happens once.
I found the problem, and it’s a real silly one. I’m not clicking back into the game properly again after I hit “refresh” in the debugger and thus it isn’t registering subsequent keypresses. Well, problem solved. Thanks for the help though. Can’t believe it was that simple.