Weird behavior with the Set Variable Node with input/output values missmatching

Hello,

So I have a countdown and I’m adding a simple function to add bonus time but it is acting weird. To investigate I have unplugged the countdown and I trigger the function manually, adding 10 sec each time.

Here is the blueprint, it is pretty straight forward.

Thanks to the print strings I have identified a weird behavior, the value for the minutes that is getting out of the Division Node isn’t always the value set by the Set Node. Which puzzle me quite a lot. Here is a screen with the print strings following several triggers of the function.

You can see that when I reach 50 seconds, the Division Node output is zero minutes, but the Set Value node which is directly connected to it, sets a value of 1.

Next it messes up the 60 seconds step which becomes 120 seconds because of the minute added, but again the 2 minutes getting out of the Division node become 1 minute in the Set node.

It gets back to a normal behavior at 70 sec but go back acting weird at 1 minute and 50 seconds.

Any help or explanation is welcome!

Did you figure it out? What happens if you by any chance do this instead:

(Set the variables before you use it)

Using the new minutes variable directly should fix it.

the issue is the pure node ‘Division’ its called when you set minutes and called again when you set seconds but now the value of minutes has changed so you get a different result

Thanks!

This is good reminder for me that pure functions are called on each execute nodes of the execution chain.