save code

This commit is contained in:
xsl
2025-11-15 17:17:27 +08:00
parent 33576ef233
commit 9975f69734
3 changed files with 14 additions and 1 deletions
+2 -1
View File
@@ -24,7 +24,8 @@ public partial class MyPlayer : CharacterBody3D
// Get the input direction and handle the movement/deceleration.
// As good practice, you should replace UI actions with custom gameplay actions.
Vector2 inputDir = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down");
Vector2 inputDir = Input.GetVector("left", "right", "forward", "backward");
Vector3 direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized();
if (direction != Vector3.Zero)
{