# Calculation not working when pulling from array.

**URL:** <https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289>\
**Category:** Blueprint\
**Tags:** math, arrays, unreal-engine, Array, Blueprint, question\
**Created:** [January 27, 2026, 4:10pm UTC](https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289 "2026-01-27T16:10:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bushwookie69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bushwookie69](https://forums.unrealengine.com/u/Bushwookie69)\
**Post date:** [January 27, 2026, 4:10pm UTC](https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289/1 "2026-01-27T16:10:07Z")

</div>

So in Img 1 this in on my character so when you lose the game it does this to save your best (highest) time. If you don’t have a higher time it wont save that float to the savegame.

 ![Calc_Problems](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/b/24b838ee35d551e0b21682867da5cc48a1fb864b.png)

In Img 2 this is my Widget that gets spawned after removing the UI. It takes your Best time according to the current level and then i send that Float into the “Calculate Seconds” func.

 ![Calc_Problems_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/d/dbda270d3065c6587bae0ecf0d9b9339e169be47.png)

This 3rd img is that Calculate seconds func. This calculate func works for my other gamemode where i am just setting 1 float and not using an array (img 4 to show) But that works fine. When pulling from this array it just wont update to new highest and doesn’t calculate right.

 ![Calc_Problems_3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/a/f/eaf5171c57022db082213417435774bf6646a26c.png)

 ![Calc_Problem_4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/d/bdd79ee6bb339a1d2be1f368dff9f5d0fbf54e94.png)

---

<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:** [January 27, 2026, 4:36pm UTC](https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289/2 "2026-01-27T16:36:01Z")

</div>

You have

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/b/5dbeba56ee1b38575c76fb844b35246e013053d2.png)

and

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/1/d01cb29b247afb5f0e6a5326713c7bb6ee5b9658.png)

I’m guessing they’re not the same function?

Another favorite possibility for me, is that ‘get current level name’ is not returning what you think it it? Are you using ‘open level’ to change levels?

---

<div class="post-metadata">

**Author:** ![Bushwookie69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bushwookie69](https://forums.unrealengine.com/u/Bushwookie69)\
**Post date:** [January 27, 2026, 4:54pm UTC](https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289/3 "2026-01-27T16:54:16Z")

</div>

Good catch on the names but they are internally the same logic. Just in different BPs so I copy/pasted it from the working bunker mode widget to the new modes widget.

I am using open level to reset/change levels and stuff yes. Is there another more solid option for changing?

Edit: Did some testing and level names consistently come back correct. Also when i ForeachLoop my array of floats (best times for each level) they come back correct too. I’m going to try to Remake the function from scratch and see if that doesn’t help.

---

<div class="post-metadata">

**Author:** ![Bushwookie69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bushwookie69](https://forums.unrealengine.com/u/Bushwookie69)\
**Post date:** [January 27, 2026, 6:39pm UTC](https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289/4 "2026-01-27T18:39:42Z")

</div>

Here is the solution. My calculation was somehow (really no clue how) working on other gamemode giving me the impression it was working overall. But the calculation was the problem. This is a easier better solution to the Seconds to mins/seconds calculation.

 ![Solution_01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/3/2/e325d4ef33124198a7780041d949555d465531ad.png)

---

<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:** [January 27, 2026, 7:01pm UTC](https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289/5 "2026-01-27T19:01:50Z")

</div>

You could put the function in a function library. That way you only need to do it once.

---

<div class="post-metadata">

**Author:** ![Bushwookie69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bushwookie69](https://forums.unrealengine.com/u/Bushwookie69)\
**Post date:** [January 27, 2026, 7:56pm UTC](https://forums.unrealengine.com/t/calculation-not-working-when-pulling-from-array/2695289/6 "2026-01-27T19:56:00Z")

</div>

Great idea i did not know of those. Thanks!
