How to create multiple collectible ?

So I have created a collectible system for a item ( so a props ingame when overlapped by player is added to a counter in the HUD )
But I don’t know how to set multiple collectibles , like for example a counter in the hud for red coins , an other for blue coins ect…

Since you made inventory i assume you already have some array set up and have some exparance with using it.

For stacking different items you could use either use map (with Class as a key and Integer as a value) or you can count stack items inside the item itself and simply don’t delete item if they are dropped or used, just subtract the stack integer inside the item and and remove item from inventory when stack is reached 0.

2nd method can be done only if you keeping objects in inventory array, if you just holding class information (purple varable not blue) in inventory then you need to use map, you could replace your array with it, but this will cost you use of integer index, here oyu will need to use item class as index

Bte for coins you can simply make integer varable for each coin type that will keep track of collected coins and +1 it when you collect the coin, it can be outside of inventory system and should be easier to manage, not to mention it slims memory footprint of your class.