save code
This commit is contained in:
+2
-1
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user