BGE: Python Error

i was watching a video on how to make a bge script and i got this error in the console. Yes i have the Logic Bricks properly set up there is an always sensor connected to a python controller. Yes the Always sensor has true pulse

Python script error - object 'Cube', controller 'Python':
Traceback (most recent call last):
File "moveX.py", line 1, in <module>
ImportError: No module named 'Bge'
Blender Game Engine Finished

import bge instead of Bge

sorry for the late reply i was busy working on another project. But i just checked and saw that i don’t have “import Bge” in the script here is the script.

import bge


def main():
    cont = bge.logic.getCurrentController()
    owner = cont.owner
    
    owner.positive.x += 0.1
    
main()

Without seeing the file, my guess is you have multiple .py files and are accidentally using moveX.py, which erroneously contains “import Bge”. The error you posted is exactly what happens for a file that has “import Bge” as its first line. Also, in the posted script, I’m guessing owner.positive.x is supposed to be owner.worldPosition.x.

yes putting “owner.worldPosition.x += 0.1” in replace fixed it thanks :smiley: