Is there any way sort an array from lowest to highest
I am currently trying to make a local scoreboard and I need a way of ordering the values from lowest to highest.
I know about the method shown here https://answers.unrealengine.com/questions/176672/sorting-float-array-numerically.html I need a way to have an array the holds both text (the player's name) and integers (the players score) and have these in order if biggest score to smallest score so I can promote these value to variables for the GUI
asked Jul 10 '16 at 03:46 PM in Blueprint Scripting
Pretty simple make 2 arrays one holds the score and the second holds the names (when adding or removing from the arrays makes sure to do the same to both of them), then just get the index of the max value remove it from the array with the names(place it in a new array that will be the final one for the names), and then remove the max number itself from the array with the scores(do the same here as the other one), now you have 2 arrays that are ordered by score, when you need the highest score take the index of 0 ( 1 2 ...and etc) from both of them and you will have the name and the score.
answered Jul 10 '16 at 04:10 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here