Hotbar and item pickups? (178112)

So ive been looking around sometime now for a tutorial that shows this and nothing has come up that i have found useful.

What i am wanting to do is have a hotbar at the bottom of the screen which has 4 boxes that are all numbered in ascending order. If the player walks over something that he is able to pickup, then it will be sent onto the hotbar where you can equipt or use it by pressing the number of the box the item is in.

You first have to make UI for the hotbar. Then in a script assign an Array with the amount of hotbar tabs and if you pick up and item, it check if the element 0 in Array is full, check if element 1 is free, and if not so on and so on. Then just put in an icon. And to save which item you have you can create a string array in which you put item names.
The code will differ a lot from person to person so I can’t just simply give it to you.