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.
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