I am currently looking for the same thing.
After searching the web this code was pointed to me as a possible solution, but I am not very familiar with tweens. This code is also really fast and I can't seem to make it turn slower.
Hope it helps anyway.
extends Node2D
onready var TweenNode = get_node("Tween")
func _process(delta):
# target to look at
var target = get_global_mouse_position()
# initial and final x-vector of basis
var initial_transform_x = self.transform.x
var final_transform_x = (target - self.global_position).normalized()
# interpolate
TweenNode.interpolate_method(self, '_set_rotation', initial_transform_x, final_transform_x, 0.1, Tween.TRANS_LINEAR, Tween.EASE_OUT)
TweenNode.start()
apply rotation
func setrotation(new_transform):
# apply tweened x-vector of basis
self.transform.x = new_transform
# make x and y orthogonal and normalized
self.transform = self.transform.orthonormalized()