I have big problem with python scripts in the game engine. I have a cube with an action in the X axis. Another cube which after clicked with mouse, starts a script.


But this gives me back only the location before action, and not after the action.

  • $\begingroup$ will you put your whole script there (or if it is long just the affected parts) it is hard to know what is going on with your script just from those two lines. Also is 'buttonLogic1' the cube with the script, or the animation? $\endgroup$
    – David
    Commented May 14, 2016 at 15:17

1 Answer 1


Bpy does not work in the game engine. Instead you have to use the game engine modules

For this particluar application, your script could look something like:

import bge

cont = bge.logic.getCurrentController()
own = cont.owner
scene = own.scene
button = scene.objects['buttonLogic1']

The standalone modules are also available in the game engine.


You must log in to answer this question.

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