I have the correct imports, and I’ve tried several different varients of this code… I have a sensor detecting the mouse clicking, and that still raises this error:
TypeError: ‘SCA_MouseSensor’ object is not iterable
def VolumeUp():
cont = bge.logic.getCurrentController()
sensor = cont.sensors["LeftButton"]
for mouse.status in sensor:
if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
vol = 1
print ("before", vol)
vol = vol + 1
print ("after", vol)