# Get SmartObjects ordered by distance to location set in request

**URL:** <https://forums.unrealengine.com/t/get-smartobjects-ordered-by-distance-to-location-set-in-request/562116>\
**Category:** AI\
**Tags:** AI-Systems, unreal-engine, UE5-0, question, Blueprint\
**Created:** [May 20, 2022, 4:18pm UTC](https://forums.unrealengine.com/t/get-smartobjects-ordered-by-distance-to-location-set-in-request/562116 "2022-05-20T16:18:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Umanaia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Umanaia](https://forums.unrealengine.com/u/Umanaia)\
**Post date:** [May 20, 2022, 4:18pm UTC](https://forums.unrealengine.com/t/get-smartobjects-ordered-by-distance-to-location-set-in-request/562116/1 "2022-05-20T16:18:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![electric93](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@electric93](https://forums.unrealengine.com/u/electric93)\
**Post date:** [September 11, 2022, 8:54pm UTC](https://forums.unrealengine.com/t/get-smartobjects-ordered-by-distance-to-location-set-in-request/562116/2 "2022-09-11T20:54:54Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![electric93](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@electric93](https://forums.unrealengine.com/u/electric93)\
**Post date:** [September 12, 2022, 12:11pm UTC](https://forums.unrealengine.com/t/get-smartobjects-ordered-by-distance-to-location-set-in-request/562116/3 "2022-09-12T12:11:03Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![alisahanyalcin](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alisahanyalcin/32/1000459_2.png) [@alisahanyalcin](https://forums.unrealengine.com/u/alisahanyalcin)\
**Post date:** [October 13, 2025, 10:04am UTC](https://forums.unrealengine.com/t/get-smartobjects-ordered-by-distance-to-location-set-in-request/562116/4 "2025-10-13T10:04:41Z")

</div>

how can i rebuild smart object collection?  
there is a option on the build menu but it’s not clickable do i need use world partition or something?

 ![Screenshot_10](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/5/80585f40df6816567dac405f40aad346459bc9de.png)

Edit; i think i need to add **Smart Object Persistent Collection** to the level and rebuild there  
well this still not solve my issue but at least i got somewhere thanks for the info

---

<div class="post-metadata">

**Author:** ![James.Keeling](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@James.Keeling](https://forums.unrealengine.com/u/James.Keeling)\
**Post date:** [August 18, 2026, 8:39pm UTC](https://forums.unrealengine.com/t/get-smartobjects-ordered-by-distance-to-location-set-in-request/562116/5 "2026-08-18T20:39:44Z")

</div>

You shouldn’t need World Partition, but you will need to enable a flag on your Smart Objects for `Can Be Part Of A Collection`IIRC. I don’t remember the exact name of the flag, but it should be similar to this. It is part of the Smart Object Component.

You should be able to find smart objects even without the persistent collection. Although that may depend on which engine version you are using. If you are on a recent-ish version, you may want to check out how Smart Objects are queried in the Gameplay Animation Sample Project. They have many systems working together for entrance locations, rotation when entering, motion matching, etc. Bonus points that all of it is done in BP so it will work in any project.

If you have further questions, reply back and let me know. I will try to help get your Smart Objects findable once more.

-James
