vec_dist is slow because it uses sqrt, especially when you have to use it many times per frame. If you want better speed, you could use the squared length (i.e. the same function as vec_dist but without the sqrt) to compare distances, although at the cost of accuracy on longer distances.


Your friendly mod is at your service.