I need to use alignAxisToVector to a object that is in added from a linked library (a group), the problem is that the object always return the same worldPosition and localPosition, even if it has moved (the movement is done by a script in the library, not the main file), so the rotation will always point to the same place.
scene = bge.logic.getCurrentScene()
obj = scene.addObject('object', 'Empty')
def main(cont):
print(obj.worldPosition)
linked to always sensor. object is linked object from above
one will always print the correct position, the other will always print <Vector (0, 0, 0)>.
The transformation seems to be applied in the ‘space’ of the original file, which is useless to me, I need the position of the stuff in the scene I’m looking at.
Well, seem likes it was just me being stupid, sorry folks. I just have to reference the objects in the groups, the groups themselves are static.
so for exemple: