Adding Upgrades in Increments

What I have is a UI that has an upgrade button and you can only buy an upgrade of the player has enough gold. You can buy in increments of 1, 10 and 100 by holding down Ctrl for 10 and Alt for 100 with each upgrade cost scaling as you upgrade. Ive set it up as the so that when neither Ctrl/Alt is pressed the upgrade increment defaults to 1.

In testing, I hold down the Ctrl button to upgrade by 10 and it works as intended with the next increment of 10 upgrade cost scaling correctly. The problem is that when I release the Ctrl button and return to upgrade by 1, the upgrade cost isn’t being calculated correctly.

Im wondering if there’s a better string of logic or if theres a small tweak I need to do. Been stuck in the weeds for a week now so any help is greatly appreciated.

Heres a few screenshots to help.

1X Event that defaults when neither ctrl/Alt is pressed:

10X function that gets called when Ctrl is pressed: (100X is similar when Alt is pressed)

Button Pressed events:

Cost adjust function that gets called after buying upgrade:

I’m sorry, but there are a total of like 5 pixels in your images, so I’ll just redesign it from what I can see.

First things first, you don’t need to call any functions with the way I’m proposing. We just want to know what our multiplier is. (Ideally the widgets would just check whatever is holding the multiplier so you don’t have 100 of the same variables)


With this, we just set our multiplier in every widget. The next step will handle the text.


For our next step, we want to set up bindings for our text rather than setting it. On your text block, we want to bind it- create a new binding.


This is where we determine what text shows up. We simply use a format text node with the format {Count}x and plug in our multiplier to the resulting pin.
This will end up showing 1x or 10x or 100x depending on our multiplier.
I used a format text node, but you can just use conversions if it’s easier to understand.

You can do the above step for whatever other text you have rather than setting the text outright.


As for the actual level up cost calculations, that can just be done using a power node. What you’re doing is taking a base amount of XP required and multiplying it by your scale each time. Ie a base of 1000 with a scale of 1.1 would go 1000 (since X^0 = 1) 1100, 1210, 1331, 1464.1 etc.

1 Like

Thanks for the quick and very detailed explanation! Ill try it out this weekend.

1 Like

Hey @Aratatarae

here is a different approach to solving your problem:

503 | AddingUpgrades.zip (86.9 KB)
511 | AddingUpgrades.zip (86.8 KB)