Skip to content

Commit 8a868a4

Browse files
2d movement cs event par
Co-authored-by: Raul Santos <[email protected]>
1 parent 59de155 commit 8a868a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tutorials/2d/2d_movement.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ on the screen will cause the player to move to the target location.
254254

255255
public override void _Input(InputEvent @event)
256256
{
257-
if (Input.IsActionPressed("click"))
257+
// Use IsActionPressed to only accept single taps as input instead of mouse drags.
258+
if (@event.IsActionPressed("click"))
258259
{
259260
_target = GetGlobalMousePosition();
260261
}

0 commit comments

Comments
 (0)