Damped Steering>Seek via Python I'm attempting to have a central turret object turn to point to a moving target. The turret is always in the center of the scene (un-moving). Using the Steering>Seek actuator is too fast and allows the turret to lock immediately to the target. I need to be able to have the turret slowly turn clockwise or counterclockwise (depending on which is shorter) at a set rotation speed until it eventually points to the target.

I found the getVectTo() Python function, which I can use to pull a local vector from the turret to the target. Unfortunately, I can't figure a way to use that vector to determine the shortest turning direction to reach the target; i.e. clockwise or counter-clockwise. 

To clarify, the logic would look like this:

if shortestRotationAngleToTarget = Counterclockwise:
    rotateTurret(turretRotationStep)
else
    rotateTurret(-turretRotationStep)


EDIT:
I've done more digging and tried to implement some of the suggestions provided so far. I believe I need to be using the .angleSigned() method applied to the turret's currently facing angle, but can't figure out how to get it working. The following screen shot shows the testing scene I'm using to figure this out. I am attempting to get the output of +90.0 returned where the error occurs.

I've posted the Blend here: GetVectTo.blend



Thanks for any suggestions!
Use a Edit Object actuator &gt; Track to instead of Steering actutator.

KX_TrackToActuator Change the time to meet your requeriments of rotation speed time = 0 = instant track to. Between 10 and 30 feels ok.

I made a demo:



Script:

from bge import logic
from random import choice

def change_objective():
    try:
        return choice([obj for obj in logic.getCurrentScene().objects if 'enemy' in obj.getPropertyNames()])
    except Exception as e:
        add_enemies()

def add_enemies():
    for obj in logic.spawn_list:
        logic.getCurrentScene().addObject('enemy',choice(logic.spawn_list))

if not hasattr(logic, 'spawn_list'):
    logic.spawn_list = [obj for obj in logic.getCurrentScene().objects if 'spawn_point' in obj.getPropertyNames()]
    add_enemies()

if logic.getCurrentController().actuators['track'].object is None:
    logic.getCurrentController().actuators['track'].object = change_objective()
    logic.getCurrentController().activate(logic.getCurrentController().actuators['track'])

if logic.getCurrentController().sensors['Ray'].hitObject:
    logic.getCurrentController().sensors['Ray'].hitObject.endObject()
    logic.getCurrentController().actuators['track'].object = None