Check Float number going up or down

Anyone know how to check when a float number is going up or down and add it to a bool. What i mean is getting player location and actor location and when u add - and a VectorLength, float number goes down when getting near it and up when getting away from it. I want to make it into a bool where its true when flaot number is going down and false when its going up.

Compare the old and new values. If new value is less than old value, then the boolean output is true

New Value < Old Value.

But its in a Event Tick how do i get the old Value when it keeps updating

On Begin Play save the current value of the thing you are tracking in a new variable called Previous Tick blah blah value

On Tick you now have the old value and the new value, do your comparison. Then at the end of the tick, update the Previous Tick blah blah value with the current value.

got it to work but used something different and simple. I used a delay node

Doesn’t look like a super clean way to do it, but if it works it works.
You might be able to use delay of 0 also

yea 0 is working interesting, why? xD but wat is a cleaner way i was stuck for a few hours see ways to make it work

A simple way to check on a float value and then set it as to check next frame. MyNumber will be being changed elsewhere.

Also, a delay of 0 means that the blueprint will wait till the next tick to perform the action.

1 Like