I'm trying to script some things in version 2.71.

To get the controller of a script, I have tried bge.logic.getCurrentController , but bge apparently is not present (unable to import). I've also tried bpy.ops.logic.getCurrentController , but logic does not have getCurrentController

Is there something obvious I'm missing? or what new command replaced this functionality? This roadblock is wasting a lot of time that could have been very productive.

Any help is appreciated


1 Answer 1


My understanding is that you must run your python script from a controller brick. The import will not work from the TEXT view. For example, the following simple script prints hello in the system console (Window->Toggle System Console) when the h key is pressed.

enter image description here

Clicking on the 'Run Script' button in the TEXT view will not work.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .