Slowly increase a float/In game money until hits correct number

Hello people so id like to have 100 gold for example and if i pick up 100 gold for the money to slowly increase(not too slow obviously) to 200 and was wondering how to do this i cant find any tutorials on it and im stumped :frowning:

thank you i think i figured out another way just as you answered haha but yeah that would probably work too lol :stuck_out_tongue: what i did was have 2 variables and on event tick it checks to see if my actual gold is equal to my visual gold and increments or deincrements accordingly based on if its a higher or lower number :stuck_out_tongue:

also i cant set your comment as the answer because you commented haha

Hmm if I’m reading correctly it sounds like you might want to do this. Without an example of your current code ima just fill in the blanks. Say you have a variable called gold and it’s an integer set at 100. You then pickup an object or press a button or whatever and you want to add to that variable another 100. To not just say take gold and instantly update it so it displays 200 you could do a for loop or a do N.

In a for loop you would pass in your gold as the start index and then add whatever amount you are getting in this case 100 to the gold variable and use that for the end index. Inside of the for loop you can then set gold to increment with a delay for however long you want in between each update.

With a do N you pretty much do the same thing but you dont need to set the start or end index just pass in the amount you want to add into the N. Then just like the for loop increment the gold variable and put in a delay for however long in between each update.

Np glad to help that happens to me all the time I get stuck on something and usually as soon as I post a question I figure it out lol.

Also set it to answer didnt know the OP couldnt set comments to answers :stuck_out_tongue:

Done and dusted ^^