So I made a button with a certain function and I have made more buttons like this and they worked. But this one seems to get triggered when only mouseover is true. Even though it should only get triggered when both mouseover and click are true. Why is this not working properly?
import bge cont = bge.logic.getCurrentController() close = cont.actuators['Scene'] act = cont.actuators['Action'] act2 = cont.actuators['Action.001'] mouseover = cont.sensors['MouseOver'] click = cont.sensors['Mouse'] resume = cont.actuators['Scene.001'] def actions(): #animations if mouseover: act.action = 'Plane.010Action' act.frameStart = 1 act.frameEnd = 2 act.priority = 0 cont.activate(act) if not mouseover: act2.action = 'Plane.010Action' act2.frameStart = 2 act2.frameEnd = 1 act2.priority = 0 cont.activate(act2) actions() #Turn off guidline and resume game def clicked(): if (mouseover and click): resume.mode = 8 resume.scene = 'Main game' close.mode = 6 close.scene = 'Guideline' cont.activate(resume) cont.activate(close) bge.logic.addScene('Main game') scenes = bge.logic.getSceneList() for scene in scenes: if scene.name == 'Main game': guide = scene.objects['Guideline'] guide.setVisible(False) bge.render.showMouse(False) clicked()