I've been struggling to make a turret look slerp at the mouse cursor appropriately. I've been trying to do this with Quaternions and believe I'm at the edge of understanding them, so forgive the code.
if result:
var ray_collision_point : Vector3 = result.position
var object_position : Vector3 = turret.position
var angle = Vector2(ray_collision_point.x, ray_collision_point.z).angle_to(Vector2(object_position.x, object_position.z))
cursor.transform.origin = ray_collision_point
var a = Quaternion(turret.transform.basis)
var b = Quaternion(Vector3.UP, angle)
var c = a.slerp(b, .5)
turret.quaternion = c
Which results in this, the arc doesn't do what I want it to do. I think the issue is in var b, but my understanding of things is on shakey ground, so any help is appreciated.