Bit late to the party but I also had some trouble finding help with this topic. I’ve attached a screenshot of my solution which in hindsight, seems pretty obvious/straight forward.
- Start with a While Loop to iterate through the list until done
- I wanted to sort the “Values” of this map so use the Max of Int Array to grab the highest value entry in the Map
- Using that node, also grab the index of that entry which you’ll need shortly
- Now use the Get node and the previously grabbed Index value to make sure you’ve got the correct entry in the map.
- Now you just shove it into a new Map (local variable) using the index to make sure you’ve got the right entry. You’re basically just copying the Key and the Value straight into a new temporary map.
- Once its shoved in the new map, remove it from the original map so that the While Loop iterator can eventually finish once the Map is emptied.
- Extra spice, reason I was sorting was so they could be added to a scrollbox list in an Editor Utility Widget. Using a similar method of grabbing the data, I could then feed the new sorted list in order as child widgets of the scrollbox.
Hopefully someone finds this helpful. Shout out if something doesn’t make sense