I'm trying to learn how to use BGE, and one of the things I'd like to do is programatically move the cube using a python script. I added a controller but no luck. See screenshot. I'm trying to run the python script at the top of the page, all it's supposed to do is move the cube a little. It works if I click "Run Script" but I want it to happen automatically when BGE is running. What am I missing?
Take the 2-minute tour
×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.
As well as using bge (the blender game engine module) instead of bpy, you want to set the true or false level triggering to get the always sensor to repeatedly call the python script. That is the buttons to the side of the Freq setting which will determine how often it will be triggered.
would be the replacement code for what you have. You may find that this will be better joined with a keyboard sensor to move the object when you press a key. |
|||||
|
bpy
in the game engine.. – iKlsR Jul 8 '13 at 15:53