Combine to Variables / Values? Order an array?

Structs let you combine some variables into one ‘structure’, and while this is how would you would solve the problem in a regular programming language, BP does not support sorting them.

Things like this are no fun in BP, but of course anything is possible…
The second array idea can work, build up a distance array as you build your result array, insert into the distance array at the appropriate place (loop and find index to insert at) and then insert into the result array at the same index.

I used actors here, I see now you are using components, so some minor changes required:

Helper function to insert into the distance array and return the index:

“Proximity Sort”:

Distances and Result List are local variables.

1 Like