# Clamping Negative Float

**URL:** <https://forums.unrealengine.com/t/clamping-negative-float/484407>\
**Category:** Character & Animation\
**Tags:** float, unreal-engine, update, Blueprint, question\
**Created:** [June 4, 2021, 8:34am UTC](https://forums.unrealengine.com/t/clamping-negative-float/484407 "2021-06-04T08:34:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hedg4r](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hedg4r](https://forums.unrealengine.com/u/Hedg4r)\
**Post date:** [June 4, 2021, 8:34am UTC](https://forums.unrealengine.com/t/clamping-negative-float/484407/1 "2021-06-04T08:34:44Z")

</div>

I have made something similar to speedometer. Where angle sets from 0.1 (left side) to -0.1 (right side). Am trying to make a smooth animation update in blueprint. When the collision box is activated value goes at (6) look first picture. After battery gets 100% value show (15 look first picture). I want to slowly update that scalar parameter with progress and all pictures below:

 ![340652-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/1/bf19734403a9f59d06bdb2f8f85edbebe99d40e7.jpeg)

 ![340653-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/8/2b8ec9145a7619b83203106ae6352aea367d4619.png)

 ![340654-3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/6/c/c6c2ad85f0947050b3d9d282b2396d5c389a3706.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 4, 2021, 9:29am UTC](https://forums.unrealengine.com/t/clamping-negative-float/484407/2 "2021-06-04T09:29:44Z")

</div>

You don’t need the lerp there, you might as well just plug the parameter into the rotator.

You might find you get a pretty good needle movement using finterp:

 ![340658-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/3/133b79b08e0b07c02addb47aeea571ff4f437274.jpeg)

---

<div class="post-metadata">

**Author:** ![Hedg4r](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hedg4r](https://forums.unrealengine.com/u/Hedg4r)\
**Post date:** [June 4, 2021, 10:26am UTC](https://forums.unrealengine.com/t/clamping-negative-float/484407/3 "2021-06-04T10:26:08Z")

</div>

Value of Current charge is from 0 to 100 and scalar parameter goes from 0.1 to -0.1. “Finterp” won’t work with my function because I don’t run delta time I am setting timer function every 1s. Any other idea?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 4, 2021, 11:44am UTC](https://forums.unrealengine.com/t/clamping-negative-float/484407/4 "2021-06-04T11:44:50Z")

</div>

If you want to do it that way, then

 ![340670-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/8/378bb20352f69514d213c5a26ca0d7c71b574df1.jpeg)

---

<div class="post-metadata">

**Author:** ![Hedg4r](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hedg4r](https://forums.unrealengine.com/u/Hedg4r)\
**Post date:** [June 4, 2021, 12:24pm UTC](https://forums.unrealengine.com/t/clamping-negative-float/484407/5 "2021-06-04T12:24:49Z")

</div>

That helped, thank you so much!
