I was having some trouble coding a sprint animation for my games character, but I seem to be having trouble. I want to the player to double tap the left and right key to enable a sprint animation. I have tried the following code (screenshot below) and it does not seem to be working. I would apricated any help on how to fix or if there is another way to do this.
I am not so great with understanding timers, they are still pretty confusing for me. Is there any way I could get an example of how this should be setup. I’ve checked the Gdevelop tutorials but they just confused me more.
So looking back on your code, I am wondering if the changeplayer variable on the character is not getting to 0,1, or 7. At first I thought maybe the Sprint variable was adding on to itself to go over 2, since you are looking for it to be equal or less than two, but since you are alternating the keys, it should clear back to 0 when the left key is released as long as you don’t have someone with quick fingers, because 1 second is a pretty long time to wait between the key strokes. So, I don’t know if this will help you, but make yourself a text box (call it info, whatever) stick it in your scene and have it display the changeplayer variable, and then make another one (call it info2, whatever) and have it display the sprint variable. See if they are even changing. It could very well be that the 1 second timer is too long a pause state to actually be adding anything (which doesn’t really matter, since you are looking for equal or less than 2 so 0 should work just fine) I am just really sus about the changeplayer variable not changing.