Just getting into working with python a bit more, the main problem i’m trying to work around is how set a property from the object with the module/script to True or False.
right now I have an always sensor (true pulse) connected to my module/script and a boolean on my cube called ‘asdf’
Here’s the code i’m using:
import bge def propertychange(): cont = bge.logic.getCurrentController scene = bge.logic.getCurrentScene own = cont.owner Cube = scene.objects['Cube'] switch = cont.sensors['Always'] if switch.positive: Cube['asdf'] = True
Neither module (with scriptname.module) or script mode of python seem to work.
What am I doing wrong?
Is there a better way to do this?