I have a scenario where the main character walks around a room. Within the room are multiple objects belonging to the same family (named FindableItems). The family has an instance variable to determine whether the object is "findable".
Among the family's "findable" objects within a certain distance, how can I determine which one is nearest to the main character Right, now it looks something like this
This results in a lot of false positives as it's not respecting the "findable" variable, and distance from the hero, when choosing the nearest object. I'm sure there's a way to do this that I'm not thinking of.