I am trying to make a tower defense game and I can detect which enemy is closest to the end, but I still need to figure out how to detect this within a tower’s range. I have heard Region3 might be able to do something like this? Just asking for any useful resources, thanks
If you really want, you could try using WorldRoot | Roblox Creator Documentation as this will detect if the outer edges and vertices are within range, not just the center position.
However, I this is really only needed for custom use cases depending on the size of the enemy models the towers are attacking. If they are all relatively small on all axes then use @Evercreeper’s answer.
I’m not saying that @Evercreeper’s solution won’t work. In fact, it most certainly will. I was merely providing an alternate method if you had certain enemy npc’s in which their size along one axis was significantly extended from the center point.