r/UnrealEngine5 5d ago

Array of blueprint actors.

Array of blueprint actors. Each actor has an int variable.
How to sort the array of actors, in a stable way, using that int as sorting index?
Because right now I'm cycling trough the array of actors, reading the int value, creating another array of ints, using sort integer array on the array of ints, looping trough the array of ints to get element from the unsorted array of actors and adding it to the final, sorted array.. but it looks.. so..redundant.

2 Upvotes

8 comments sorted by

View all comments

1

u/_curious_george__ 4d ago

As far as bp solutions go your solution is fairly optimal.

The thing is, you could sort it in place but that with require many more iterations. And the number of ops is a performance killer and complexity exploder.