Skip to content

Commit a81cc1b

Browse files
committed
2d movement click move update cs
1 parent 199fb54 commit a81cc1b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tutorials/2d/2d_movement.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,9 @@ on the screen will cause the player to move to the target location.
254254

255255
public override void _Input(InputEvent @event)
256256
{
257-
if (@event is InputEventMouseButton eventMouseButton)
257+
if (Input.IsActionPressed("click"))
258258
{
259-
if (eventMouseButton.ButtonIndex == MouseButton.Left && eventMouseButton.Pressed)
260-
{
261-
_target = GetGlobalMousePosition();
262-
}
259+
_target = GetGlobalMousePosition();
263260
}
264261
}
265262

0 commit comments

Comments
 (0)