From 8a868a48086dafc55f3998bc849b6a6ff4ed5e99 Mon Sep 17 00:00:00 2001 From: HubbleCommand <39958198+HubbleCommand@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:33:38 +0200 Subject: [PATCH] 2d movement cs event par Co-authored-by: Raul Santos --- tutorials/2d/2d_movement.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tutorials/2d/2d_movement.rst b/tutorials/2d/2d_movement.rst index db99a86c5..1f5da929b 100644 --- a/tutorials/2d/2d_movement.rst +++ b/tutorials/2d/2d_movement.rst @@ -254,7 +254,8 @@ on the screen will cause the player to move to the target location. public override void _Input(InputEvent @event) { - if (Input.IsActionPressed("click")) + // Use IsActionPressed to only accept single taps as input instead of mouse drags. + if (@event.IsActionPressed("click")) { _target = GetGlobalMousePosition(); }