My idea when I did a track-to-nearest was to make the player track to an empty, that just moves to the position of the nearest enemy whenever they’re close/player’s aiming.
That way, you get the smooth turning that the actuator gives you, rather than a quick rotation. I did it this way purely because as far as I know, you can’t modify the track-to actuator’s object via python at this moment.
Probably not the best way to do it but it works, and it gives you a very good looking result. Plus it’s very easy to use
You might also want to tack another alignAxisToVect() to keep your character pointing upright.
own.alignAxisToVect( (0,0,1), 2, 1.0 )
This keeps your positive Z axis aligned with the world’s positive Z axis, and will keep your character from rolling/tilting inappropriately while trying to track.
This is the equivalent of defining the “Up Axis” for the track-to actuator.