Character rotation separate from movement

Godot Version

4.3

Question

(2d, top-down view game). Ok, I managed to implement smooth movement in different directions on the WASD buttons, but I don't understand at all how I can make a separate rotation of the character in different directions, which would be triggered by pressing the arrows on the keyboard (In other words, so that movement and rotation can be performed independently, separately). Thank you very much in advance.

if you’re using AnimatedSprite2D or Sprite2D you can achieve that toggling flip_h and flip_v according to what key you press
it kinda depends on how you coded movement of the player, but in theory it shouldn’t change anything about the sprites directly
hope this helps