# Detect weather a value is increasing or decreasing

**URL:** <https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973>\
**Category:** Blueprint\
**Tags:** boolean, unreal-engine, UE4, Blueprint, question\
**Created:** [December 1, 2016, 1:32am UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973 "2016-12-01T01:32:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrGrins](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrGrins](https://forums.unrealengine.com/u/MrGrins)\
**Post date:** [December 1, 2016, 1:32am UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973/1 "2016-12-01T01:32:19Z")

</div>

How would I do this in blueprints?

pseudo code would be something like:

if value is increasing print “up”

if value is Decreasing print “down”

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [December 1, 2016, 3:29am UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973/2 "2016-12-01T03:29:58Z")

</div>

Check the input and see if it is negative. If it is, print down.

Or if you dont get the delta all the time: Check to see if the new value is greater than the old and if it is, print up. If it isnt, print down.

Hth

---

<div class="post-metadata">

**Author:** ![MrGrins](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrGrins](https://forums.unrealengine.com/u/MrGrins)\
**Post date:** [December 1, 2016, 3:35am UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973/3 "2016-12-01T03:35:25Z")

</div>

What I want to do is check if the new value is greater than the old value, but I’m having trouble figuring out how to do it

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [December 1, 2016, 3:57am UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973/4 "2016-12-01T03:57:20Z")

</div>

If(oldValue \> newValue) print increase  
Else print decrease

---

<div class="post-metadata">

**Author:** ![MrGrins](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MrGrins](https://forums.unrealengine.com/u/MrGrins)\
**Post date:** [December 1, 2016, 4:35am UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973/5 "2016-12-01T04:35:02Z")

</div>

sorry, new problem, how do I get the old value? I tried making two variables and somehow storing the old value in one. but I can’t get it 😕

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [December 1, 2016, 5:15am UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973/6 "2016-12-01T05:15:28Z")

</div>

That is exactly what you have to do. OldVal = NewVal; NewVal = InputVal;

---

<div class="post-metadata">

**Author:** ![Mihaitaba1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mihaitaba1](https://forums.unrealengine.com/u/Mihaitaba1)\
**Post date:** [September 25, 2022, 7:24pm UTC](https://forums.unrealengine.com/t/detect-weather-a-value-is-increasing-or-decreasing/377973/7 "2022-09-25T19:24:42Z")

</div>

What you are saying makes no sense.
