One idea is to do something like this.
const ROTATION_SPEED := 1.5
const ROTATION_DAMP := 3.0
const DAMP_CLAMP := 0.005
var spin := 0.0
func _process(delta):
_rotation(delta)
func _rotation(delta) -> void:
var rotation_right = Input.is_action_pressed("rotation_right")
var rotation_left = Input.is_action_pressed("rotation_left")
if rotation_right and rotation_left:
spin = 0.0
elif rotation_right:
spin = 1.0
elif rotation_left:
spin = -1.0
elif abs(spin) > DAMP_CLAMP:
spin = lerp(spin, 0.0, ROTATION_DAMP * delta)
else:
spin = 0.0
rotate_y(spin * ROTATION_SPEED * delta)
That's for keyboard controlled rotation but I think you can see what it's doing. It's also got clamping which you might not need, you could just have your rotation happening constantly if that fits better with the game.