diff --git a/Player.gd b/Player.gd index e379163..6a47c1a 100644 --- a/Player.gd +++ b/Player.gd @@ -16,7 +16,16 @@ func gravity(): func walk(): walkDirection = Vector2.ZERO - #if input + if Input.is_action_pressed("MoveForward"): + walkDirection.x += 1 + if Input.is_action_pressed("MoveBack"): + walkDirection.x -= 1 + if Input.is_action_pressed("MoveRight"): + walkDirection.y += 1 + if Input.is_action_pressed("MoveLeft"): + walkDirection.y -= 1 + + print("Player walkDirection: ", walkDirection) func motion(delta): self.move_and_slide(velocity * delta, Vector3.UP)