Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Nearest npc still not nearest

Joined
Feb 21, 2016
Messages
60
Not sure if this is a bug or works as intended. But when filtering for NPC's and using the 'nearest()' it does find the 'nearest' on the grid but doesn't keep in mind the obstacles. So often enough instead of having the actual nearest it returns an npc that is far away because of the obstacle in between. Is there a way to use 'nearest' method api with obstacle awareness? Or was it supposed to be obstacle aware already?
 
Joined
Feb 21, 2016
Messages
60
By specifiying a Distance algorithm you're able to determine the nearest LocatableEntity that suits your needs.
Method: LocatableEntityQueryResults
Distance Algorithm: Distance.Algorithm

Ah, I overlooked the documentation, didn't see the optional parameter.
The documentation doesn't say much about the algorithms themselves and after googling a bit I don't get the idea of what they do either. So I guess I'll just try them all and see what they do.

Thanks!
 
Top