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)
from math import sqrt
#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
#add to position
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…