How set actuator properties while the game is running? When I call bpy.data.objects['Enemy'].game.actuators['&lt;name&gt;'].target = bpy.data.objects['XX'] the value is only updated after pressing Esc to quit  game and then hitting P to start the game again. 

How can I update the target in real time,  without the need to stop and start the game again?
The bpy module does not work in the game engine, use the bge functions instead.

For instance:

objectList = bge.logic.getCurrentScene().objects
bge.logic.getCurrentController().actuators['&lt;name&gt;'].target = objectList['XX']


More information can be found on the bge.logic and bge.types pages of the blender python api.