Hello!
So I have recently been working on a inventory system. So far everything worked out but one thing. My goal is to sort all the imagebuttons from a frame in the right order however it appears that everytime I play, the sorting is random. I have also looked on multiple websites to try and solve the issue but none have proven useful so far. How would I go about sorting them?
Basically I want to make an inventory system like in the game rust. I finished the dragging and the overall gui and now I’m trying to add a check like whenever the player picks up an item, the script checks which slots are occupied and if any slots are empty it places the item into the first slot available.
Set SortOrder property to LayoutOrder and programmatically clone the GuiObject slots into the parent frame in a specific order. This way, your code would do the sorting for you since the alpha-numeric sort isn’t doing what you want.
Set SortOrder property to Name to sort them alpha-numerically, and give each slot a new Name property which refers to what they are. (e.g. if this was an inventory, one slot might be “apple” and another “pear”)
I added a UIGridLayout already and I’d like to keep it for simplicity so I will probably try the other poster’s method since it does seem to work. Thanks anyways
Tried that and it didn’t work but I am now making a script that adds multiple slots in order once the player has joined the server. Hopefully this will work