How to identify overlap or trace?

Hi guys, tell me please how correctly to build a logic. I have classical TD(tower defense). I need that my tower took in his radius enemy and attacked him. I made it through trace, is it correct? Tell me please how do you do it in your games.
p.s. making in blueprints

Best regards, Alex.
p.p.s. Sorry for my English

That is usually done by simply first checking if the enemy is in the radius, and then checking if you can see the enemy.

Checking for “in radius” can be done by simply looping through all the enemies and calculating that radius and see if it is closer than some limit.
This can be very efficient if you compute the square of the desired distance (so if a 20 meter distance is desired, the 2000cm x 2000cm is 4000000) and compare the square of the distance between the tower and the enemy. The blueprint node to get the square oif the distance is much faster than the one to get the distance.

Line of sight can then be done with a trace on the visibility channel. You get back the nearest visible Actor.

You may run into the problem of hitting the tower first. You can solve that by do a Trace all and get the array. Then look at each item in the array and ignore the tower. That should not be needed though.

Thanks for your reply, I will try.