Hi all
I wanted to make smth like this.
-----------------------
If Player press "e" and Variable.e = 0 than
set speed = 500
Variable.e = 1
-----------------------
If variable.e = 1 than
every 4000 miliseconds
Variable.e = 0
-----------------------
If variable.e = 0 than
set speed = 200
-----------------------
Which I just wanted to make is 4 second boost.
First Problem : On first e press, Variable.e doesn't turn to 1. On second press it sometimes turns to 1, after that it returns to normal.
Second Problem : When it turns to 1, it should return to 0 exactly 4 seconds later. But it sometimes turns to 0 after 1 second or 2 seconds or even 0,5 second and sometimes after 4 seconds.
Whats going on ?
It's like, it doesn't start to count from 0 to 4000 when I press to e. It's like, it starts to count on layout start, and on e press It's a luck to catch it on 0 , sometimes you may catch it on 3500. So after 500 miliseconds, it reaches to 4000 , so condition becomes true and variable.e turns to 0.
I hope I could explain my problem.