We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1508be4 commit 626d31dCopy full SHA for 626d31d
tutorials/2d/2d_movement.rst
@@ -231,9 +231,9 @@ on the screen will cause the player to move to the target location.
231
var target = position
232
233
func _input(event):
234
- if event is InputEventMouseButton:
235
- if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
236
- target = get_global_mouse_position()
+ #use is_action_just_pressed to only accept single taps as input
+ if event.is_action_pressed("click"):
+ target = get_global_mouse_position()
237
238
func _physics_process(delta):
239
velocity = position.direction_to(target) * speed
0 commit comments