I hope that was clear enough.
I have a Vector3 called destination.
I have a list of Vector3’s called possible destinations.
I have a list of Vector3’s called obstacles.
If my destination is closer than X from any obstacle in the list:
Find a Vector3 in the possible destinations list that is closest to the destination but still farther than X from all obstacles?


It sounds like a two-step filter. I imagine you would just iterate your ‘possible destinations list’ and see which ones fit the criteria, then choose the closest one.
So probably ordering them by distance in the first pass, then finding the first one that is X units away from the obstacles? or even the other way around should work i guess
Sure… if there’s only a few, either order would probably be fine.
Usually you want to reduce your dataset first, THEN sort it, just to reduce computation expense
But if it’s only a few items, eh, probably be fine either way.
2 Likes
I imagine you’ll also need to handle the case where no Vector3 in the possible destinations list meets the criteria.
1 Like