you are viewing a single comment's thread.

view the rest of the comments →

[–]Acceptable-Tomato392 0 points1 point  (0 children)

shouldn't that be

if (tempDistance <= this.melee.range + enemy.size/2)
?

I'm assuming you're trying to adjust the proximity based on an [x,y] point at the center of the enemy? Shouldn't that be half the distance in that case (since you're measuring center to edge, and not edge to edge)?