getting property sensor(changed mode) exact value

How do i get the exact value that was detected as changed with property sensor?
new vs old value

I am trying to use the value it changes as a variable

So you have a property “SomeName” and you have a sensor Property set to Changed and you selected “SomeName” as the property to check for changes ?

Can’t you just read the “SomeName” property ?

Do you want to know the old value or the new value ?

You can use that value by entering the properties name instead of a number for example.

i want to know the difference in how much it changed, not what it currently is

how do i set up a’difference’ function?
i am considering this might be based on a delay sensor or a ‘less than every tic frequency’ setting

with a couple of temporary vales

previous_val = ‘prop being sensed’
if propchange.positive:
new = prev val - property being sensed

that doesn’t seem like it would work since prev val would just change in the ‘if statement’ i would assume, so yeah, tried that, it just equals 0 of course

What are you using to change the properties value ?

If you detect a change its already too late, you must save the old value before changing it.

what is a method of saving values

Well it depends on the way you are changing the value. Can you post a screenshot or something to give me more info. I don’t even know are you using Python or Logic Bricks.

python, logic brick combo. its fine, i think i figured out a way around it

Try this maybe:

Attachments

Change_Value.blend (72.3 KB)

This looks nice thank you. the expression possibility in the value area of the property actuator had never occured to me, thank you again

There is no build-in option to get the stored value of the property sensor. Therefore you need to do that by yourself.

This is not difficult and does not require Python at all:


Each time the property “value” changes, it’s value will be copied to the property “oldValue”. This happens after the controllers. This means at the frame when the property change sensor was positive the property “oldValue” still contains the value from the frame before and the property “value” contains the new value.

With that knowledge you can use any logic you like to operate on both properties. Python, Expression, Bricks it does not matter as long as it is within the same frame.

Expression example:


Python example:


Attention: Make sure to read the property “oldValue” within the frame after “value” changed. Within the next frame “oldValue” will be changed.

That is awesome monster thank you