So the intended result should be that if I press Z or "corn" it should print corn since tester is at 0,
then switch tester to 1. Then If I press it again it prints not corn and set the tester to 2, until it resets
The problem is if I press Z or "corn" it just fires it all at once. so it prints the words "corn", "not corn" and "not corn two" all at the same time rather than per button press
I have wasted 2 hours on this already :(
Here's the code ,Thanks in advance!
var tester = 0
## corn stands for the Z key
func _process(delta):
if Input.is_action_just_released("corn") and tester == 0:
print("corn")
tester = 1
if Input.is_action_just_released("corn") and tester == 1:
print("not corn")
tester = 2
if Input.is_action_just_released("corn") and tester == 2:
print("not corn two")
tester = 0
pass