A super simple way to put this is on keypress space now when you go to add one to a variable instead of choosing from a drop down of global variables that exist in the project you could put an expression in for the variable name and you would put for example sprite1.animationname then value +1 if that makes sence.