How to get the sensor that send the pulse if there are more then 1 sensors connect

Hi I have tracking multiple sensors ( mainly property sensor) I wanted to know which senor pulsed . how can i get the sensor that trigger the pulse ?

bge.types.SCA_ISensor.positive
bge.types.SCA_ISensor.triggered

Do you mean that i have iterated thru the list and check each sensor?


from bge import logic

cont = logic.getCurrentController()
own = cont.owner     #if you need this for anything...

sensor1 = cont.sensors['sensor1']
sensor2 = cont.sensors['sensor2']
sensor3 = cont.sensors['sensor3']

if sensor1.positive:     #Do this!
if sensor2.positive:
     #Do that!
if sensor3.positive:
     #Do the other thing!

Type this into a text block, set it to a Python controller (script, not module), and connect all your sensors to it. The names of the sensors need to be identical to the names given in the [‘sensorX’] portions of the script.

This will check all three sensors for a pulse, and trigger their effects. If all three sensors are positive, it will trigger all three events. Exactly where you go from there depends on what you’re planning on having these sensors trigger.