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.
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!
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!
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
You shouldn’t need World Partition, but you will need to enable a flag on your Smart Objects for Can Be Part Of A CollectionIIRC. 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.