I have an array of GameObjects, which I made with FindObjectsWithTag functon. Now each of the objects in that array has the same script attached. I want to sort the array so that it uses a variable from the script to sort.
Is there a simple method of doing it or do I have to code it in myself?
I think you will have to write the code yourself.
Which should look like :
Iterate each element of the first array. For each value of the variable, iterate on the second array (which is going to be sorted). If the value is greater than the current element observed, insert that element into the second array.