Hi everyone. I'm using keyboard for character movement. However, It seems like there is pause between "pressed" and "held". I'm using default "ui_left", "ui_right", "ui_up", "ui_down". Can this pause be disabled ? My game is supposed to be fast paced and 1/2 sec long pause every time you change direction it will most likely cause death.
Pause between pressed and hold ?
There shouldn't be any pause between pressing keys and causing an action to happen?
Can you post the script you're having trouble with?
@Ace Dragon said: There shouldn't be any pause between pressing keys and causing an action to happen?
Can you post the script you're having trouble with?
Sure, my move function is here : `func _move(event): if game_globals.data.use_mouse == false:
Vertical
if Input.is_action_pressed("ui_up"): move_dir.y = -1 if Input.is_action_pressed("ui_down"): move_dir.y = 1 if !Input.is_action_pressed("ui_up") && !Input.is_action_pressed("ui_down"): move_dir.y = 0
Horizontal
if Input.is_action_pressed("ui_left"): move_dir.x = -1 if Input.is_action_pressed("ui_right"): move_dir.x = 1 if !Input.is_action_pressed("ui_left") && !Input.is_action_pressed("ui_right"): move_dir.x = 0
Finish the shit
move_dir = move_dir.normalized() move_dir = ((move_dir 8) spd) par_delta else: if event is InputEventMouseMotion: move_dir = (event.relative/ 30) spd move_and_collide(move_dir)
Keep da player insida da level
if transform.origin.x < 6: transform.origin.x = 6 if transform.origin.x > 186: transform.origin.x = 186 if transform.origin.y > 103: transform.origin.y = 103 if transform.origin.y < 13: transform.origin.y = 13`
spd is speed modifier, some ships are slower. par delta is delta. This is base class and classes of specific ships inherit it.
Pause looks like this :
It moves a little and then it waits before start moving.
Ultimately, I found solution myself. I found that this effect is called typematic delay . Possessing knowledge of correct term, looking for solution was easy. I'm still new to GoDot, I should get used to this. Problem was fixed by moving code into _physics_process
from _input