Get SmartObjects ordered by distance to location set in request

Hello,

I’m using the smart object system to find smart objects which fits the request params. However, I can’t find a way to get the result array ordered by distance to the location of the query box.

They are different ways to handle this but wanted to check first if this is not already supported.

Thank you

Hello Umanaia,
I’m sorry that I can’t help you with your issue, but how were you able to find the smart objects? I’m on UE5.0.3 and even though I added the SmartObject component I’m not able to find any SmartObjects via the node … if you have any tips for me, it would be greatly appreciated!

Thanks!

Okay I just solved my own problem. If anyone is having issues with finding the SmartObjects, make sure they’re registered in the SmartObjectCollection and if not, rebuild the collection manually. Cheers!

Regarding your problem Umanaia, I believe the SmartObjects retrieved from the SmartObjectCollection are not ordered by default and are only selected by distance. Meaning you’d either have to change the way the SmartObjects are retrieved in the C++ function or order them yourself in Blueprints. By getting all the positions, map them to the SmartObjects and then order the positions. Hope this helps!