Havent tested this yet but you are using the following calculation for the distance:
Local dist:Float = relx * relx + rely * rely + relz * relz
If I remember geometry well enough, you should take 3th root of that.
Since you compare it to the 2nd power of minDist, you actually took the 2nd root.
Local dist:Float = relx * relx + rely * rely + relz * relz
If I remember geometry well enough, you should take 3th root of that.
Since you compare it to the 2nd power of minDist, you actually took the 2nd root.
EDIT: Nope, on second read, I misread his code. You're right.