From 3acdc258c0d136bf8f0dd40bb1a3d3f240eedfb3 Mon Sep 17 00:00:00 2001 From: Niklas <10616926+Varusal@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:50:18 +0200 Subject: [PATCH] Changed clamp code to be the same as in the demo sample --- getting_started/first_2d_game/03.coding_the_player.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/getting_started/first_2d_game/03.coding_the_player.rst b/getting_started/first_2d_game/03.coding_the_player.rst index 2df7e9c41..95be85706 100644 --- a/getting_started/first_2d_game/03.coding_the_player.rst +++ b/getting_started/first_2d_game/03.coding_the_player.rst @@ -297,8 +297,7 @@ the ``_process`` function (make sure it's not indented under the `else`): .. code-tab:: gdscript GDScript position += velocity * delta - position.x = clamp(position.x, 0, screen_size.x) - position.y = clamp(position.y, 0, screen_size.y) + position = position.clamp(Vector2.ZERO, screen_size) .. code-tab:: csharp