Get closest hit to origin in a multi sphere trace?

Implemented a prototype in BP for anyone curious.

Basically take the hits, loop them, get the distance between trace start and the actor. Now add this to a Map variable with float key and the hit as the value. Once that’s complete get the keys from the map and sort them (I’m using LE Extended Standard Library here for this). Now loop the keys and add them to a sorted hits array using a foreach break and break the loop once you’ve the number of hits you want. You can optionally reserve the sort to get the furthest hits.