diff --git a/Assets/Scenes/SingleScenes/SoulPlayer.cs b/Assets/Scenes/SingleScenes/SoulPlayer.cs index da832be..84ec6ab 100644 --- a/Assets/Scenes/SingleScenes/SoulPlayer.cs +++ b/Assets/Scenes/SingleScenes/SoulPlayer.cs @@ -136,17 +136,20 @@ public override void _PhysicsProcess(double delta) var mouse = GetViewport().GetMousePosition(); - Velocity = - new Vector2( - Input.GetActionStrength("ui_right") - Input.GetActionStrength("ui_left"), - Input.GetActionStrength("ui_down") - Input.GetActionStrength("ui_up") - ).Normalized() * Speed; - if (Input.IsActionPressed("mousedown")) { + // Move player by mouse var direction = (mouse / main.camera.Zoom) - Position; if (direction.Length() > 1f) - Velocity += direction.Normalized() * Speed; + Velocity = direction.Normalized() * Speed; + } + else + { + // Move player by keyboard or controller + Velocity = new Vector2( + Input.GetActionStrength("ui_right") - Input.GetActionStrength("ui_left"), + Input.GetActionStrength("ui_down") - Input.GetActionStrength("ui_up") + ).Normalized() * Speed; } MoveAndSlide();