# Float Interval

**URL:** <https://forums.unrealengine.com/t/float-interval/342320>\
**Category:** Blueprint\
**Tags:** float, unreal-engine, question, Blueprint\
**Created:** [December 24, 2015, 12:57am UTC](https://forums.unrealengine.com/t/float-interval/342320 "2015-12-24T00:57:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wicked](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wicked](https://forums.unrealengine.com/u/Wicked)\
**Post date:** [December 24, 2015, 12:57am UTC](https://forums.unrealengine.com/t/float-interval/342320/1 "2015-12-24T00:57:40Z")

</div>

I’m trying to scale an object based off its distance from another object (A and B). The distance is dynamic and is constantly changing (X). Currently I am getting the world location of both objects and subtracting them from each other and then getting the abs value between point A and point B (A-B=X)(X is Absolute).

Now where I’m stuck is based off of X (0-Infinity) I want to scale A every time I pass a set interval (Z). Every time I increase/decrease X by Z I want to scale A accordingly. Problem is I cant seem to figure out how to setup a check for if X has increased/decreased by Z in blueprints.

Please help.

---

<div class="post-metadata">

**Author:** ![Wicked](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Wicked](https://forums.unrealengine.com/u/Wicked)\
**Post date:** [December 24, 2015, 7:42pm UTC](https://forums.unrealengine.com/t/float-interval/342320/2 "2015-12-24T19:42:40Z")

</div>

So this is what I came up with for checking if X has overlapped our interval threshold. The equation runs off event tick. Everything past select float to Reset DoOnce is the formula.

[![Interval Equation photo Interval_zpswhnopmaq.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/d/d9d587b1c107d0909867fb0ba7c4bc34a8e864ba.png)](http://s1369.photobucket.com/user/grandmasterwicked/media/Interval_zpswhnopmaq.png.html)
