i just started learning blender and its scripting and tried to run its sample code
import bge
def main():
cont = bge.logic.getCurrentController()
own = cont.owner
sens = cont.sensors['mySensor']
actu = cont.actuators['myActuator']
if sens.positive:
cont.activate(actu)
else:
cont.deactivate(actu)
main()
and get the following error: ImportError: No module named 'bge' i searched for a solution but couldn't find any.how to solve this problem? i am using blender 2.65
In 2019, with the release of Blender 2.8, the Blender Game Engine was entirely removed from Blender itself. The engine's capabilities and appeal had largely fallen behind other rising game engines of the time, and it was difficult to update both Blender itself alongside the game engine.
Blender has its own built-in Game Engine that allows you to create interactive 3D applications or simulations. The major difference between Game Engine and the conventional Blender system is in the rendering process.
Collection of the fake Blender Game Engine (BGE) Python API module for the code completion.
Running import bge does not work when you press "Run script" or try to issue this command in the terminal. You have to press "P" to activate game engine mode. To run your script, connect a controller to the script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With