Use Float to Add 1 Collected Object To Widget

I have a glowstick with an Inventory, and when I throw a glowstick the count decreases, but when I pick it up it won’t increase.
How do I change the float so the count increases?

(Increase Function)

(Interreacting with the glowstick, calling the function).

(The glowstick count in widget)
image

I’m not sure if i can help… But maybe your widget is not updating correctly the increase logic either that or the 1 + glowstick logic increases the counter only once…
bandicam 2023-07-12 18-13-39-231

if thats the case maybe try to replace it with “Increment” +1 node there… If the widget is not updating correctly the increase but it does on the decrease when you throw a stick. Then try to put your increase logic there as well just reversed where ever this decrease logic is…

Can you show where the decrease logic is ? Maybe you awso need to plug in your increase logic to your text widget node at the end of your increase function just like the decrease is plugged to the text widget somewhere not sure…

If i take my increase health and decrease health logic which works i see that both are ending with the new values connected to the text widget so it updates if the health goes up or down accordingly. On your function i don’t see where you update the +1 glow sticks to the text widget to be updated there as well… Maybe thats the problem.

Here my increase/decrease health logic both go to “set text” node to the widget so both update it correctly…


I don’t know if i read your code wrong, but it seems, that you just add 1 to the “Max Glowstick” float variable and not the Glowstick Amount.
Furthermore you are clamping the value of the “Glowstick Amount” float variable to Min: 1 and Max: 1, which means that the “Glowstick Amount” variable can only be 1.
You should connect glowstick amount to the “Increase Amount” input inside the function, and clamp the value to the preferred min and for max you would use your “Max Glowstick” float variable (Which you need to set to a Value for it to make sense of).
Hope it helps!