I assume this should work but I haven't tested it yet.
export var angular_acceleration = 2
func lerp_angle(from, to, weight):
return from + short_angle_dist(from, to) * weight
func short_angle_dist(from, to):
var max_angle = PI * 2
var difference = fmod(to - from, max_angle)
return fmod(2 * difference, max_angle) - difference
func _physics_process(delta):
var direction : Vector2 = target_position - global_position
direction = direction.normalized()
rotation = lerp_angle(rotation, direction.angle(), angular_acceleration * delta)