Property Sensor and python


(Doc Holiday) #1

How can i get access to the Max values of an Interval Property Sensor?
Sens.getValue() only gives me the Min Value. :frowning:

Thx, Doc


(lizard809) #2

i dont think you can, but whats the point when you can do the whole interval sensor within python


(Doc Holiday) #3

I found it:

Write in Sensors Fields:
Min: PropertyName
Max: PropertyName+0.1

Now set the Property in the Script:
Own.PropertyName = 5

Now the Sensor fires from 5 till 5.1. Coooool! :smiley:
Doc


(saluk) #4

???

Why don’t you just use python to read the property, instead of a property sensor?


if property >= 5 and property <= 5.1:
    code

would have the same effect as using the sensor.


(Doc Holiday) #5

The Script was ‘fired’ by the Sensor, 'cause i want to run it less Times as possible to save Resources. … first Rule: “If it’s not needed, it should not be calculated.”