Explorar o código

Mark the input as handled once proceed

May optimize engine flow.
DricomDragon %!s(int64=5) %!d(string=hai) anos
pai
achega
5bf585112f
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Player.gd

+ 2 - 0
Player.gd

@@ -57,8 +57,10 @@ func _unhandled_input(event):
 	if event.is_pressed():
 		if event.is_action(turn_left_action):
 			dire_delta = -1
+			get_tree().set_input_as_handled()
 		elif event.is_action(turn_right_action):
 			dire_delta = 1
+			get_tree().set_input_as_handled()
 
 func _on_game_start():
 	move()