hmmm… interesting, didn’t know you could use track to on armatures.

I’m a bit stuck with the code… and I don’t have time to finish it right now…

```
from math import *
cont = GameLogic.getCurrentController()
#the sensors:
main = cont.getSensor("main").getOwner() #the head object
skeleton = cont.getSensor("skel").getOwner() #the armature
target = cont.getSensor("target").getOwner() #the object the head will be looking at
#
pos1 = main.getPosition()
pos2 = target.getPosition()
#horizontal angle
if not (pos2[0]-pos1[0]==0):
hangle = (atan((pos2[1]-pos1[1])/(pos2[0]-pos1[0])))
else:
hangle = pi
if ((pos2[0]-pos1[0]) > 0 and (pos2[1]-pos1[1]) > 0):
hangle = degrees(hangle)
if ((pos2[0]-pos1[0]) < 0 and (pos2[1]-pos1[1]) > 0):
hangle = degrees(hangle + pi)
if ((pos2[0]-pos1[0]) < 0 and (pos2[1]-pos1[1]) < 0):
hangle = degrees(hangle + pi)
if ((pos2[0]-pos1[0]) > 0 and (pos2[1]-pos1[1]) < 0):
hangle = degrees(hangle + (2*pi))
skeleton.right = hangle*<b>frames</b>/360
```

where **frames** are the number of frame in the right-left animation…

The part that isn’t working is the angle in the verical direction… Maybe you should just use a script to convert the orientation matrix to degrees… I will pick it up again when I have time… maybe tomorrow, or the day after that