property sensor/actuator

The property actuator allows me to assign one property to the same as another, but I can’t use the property sensor to check if a property is the equal to another property without using an expression and an always sensor.




If ammo equal Clipsize

I think you just type it in,

That doesn’t seem to work as the value assumes that you are telling it a string, not the name of a property.

here ya go

this uses python to set the value the sensor is looking for using another property own[‘Max’]


SetPropertySensorValueUsingPython.blend (420 KB)

also I noted you can set the property sensor to fire if the expression is true

via mode

That’s useful, but I can do that with an expression :confused:

Yar however - setting the property sensor mode to 5 should fire your expression controller without using always?

property sensor---------expression---------Do thing
always(one time)--------/

Btw for this, I just have the reload button run a check to see if it needs to reload,

also… check this file out :smiley:


I do all the reloading, and timing, and shooting using the same python script.

Note - The always sensor firing the script could be replaced with


The property sensor uses the value as you enter it. e.g. you enter abc-
The property actuator interprets the value. e.g- you have to surround strings with “” = “abc”

To compare two properties you can use the expression controller: ammo == clipsize
to avoid unnecessary processing you trigger the controller only if one of the properties changes:

property sensor [not pulse] mode:Changed

Good idea, I was thinking property sensor set to mode 5 by python, but then the python triggers every time the sensor fires,

property-----------expression---------do stuff
______-----------python(set mode)