OK so I can get an object to move with the mouse, how do I get a mouse over and click event to fire a python script? If you AND the two events together you can’t then pipe the output into a python script.
In other words how do I AND two sensor outputs into a python script?
Do I set some global property and then use logic in python or what?
The first way is exactly what I wanted to do. I didn’t think it exsisted as when I did print dir() it only gave me two methods. So ispositive is a built in method? I feel like I am stumbling around in the dark on this, but it is interesting…well anyway I tried it and so far have not achieved sucess. This is what I did:
import Blender
import GameLogic
c = GameLogic.getCurrentController()
mouseL = c.getSensor(“mouseL”)
mouseR = c.getSensor(“mouseR”)
o = c.getOwner()
if mouseL.isPositive:
<indent> print “mouse left click”
if mouseR.isPositive:
<indent> print “mouse right click”
I don’t get any errors, it is just that it does not matter which button I click, both statements get printed, what am I missing, possibly my brain.