what exactly is the intent in this code?

go to possion head.x head.y head.z in speed:

if you mean you want an object to move towards the head at a certain speed, I believe you’d need to get the vector towards it (head.position-own.position)

normalize it (divide X,Y,and Z amounts by the vector’s total length, I believe)

then multiply by the speed you want. you can then add this to the object’s current position, or set it in a motion actuator.

pseudo-code to do this (untested)- all the places where there are 5 spaces should be replaced with [tab] (can’t put tabs in this forum)

```
g=GameLogic
c=g.getCurrentController()
o=c.getOwner()
from math import sqrt
#function calls
def pythag(A):
return sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2])
def normalize(A):
B=pythag(A)
return [A[0]/B,A[1]/B,A[2]/B]
#get head's object index
oblist=c.getCurrentScene().getObjectList()#not sure if it should be g.get... or c.get... in the beginning of this line
head=oblist["OBhead"]#replace OBhead with the name of the head object plus OB at the beginning. this must be spelled exactly correct, including caps
speed=1#change this value
headPos=head.getPosition()
oPos=o.getPosition()
moveVec=[headPos[0]-oPos[0],headPos[1]-oPos[1],headPos[2]-oPos[2]]
moveVec=normalize(moveVec)
moveX=moveVec[0]*speed
moveY=moveVec[1]*speed
moveZ=moveVec[2]*speed
#add to position
o.setPosition([oPos[0]+moveX,oPos[1]+moveY,oPos[2]+moveZ])
```

I have a feeling this is more complex than it needs to be, but I tend to overthink things, and I don’t have blender in front of me…