There are differrent ways to accomplish this and collision is one of them but maybe a bit more reliable is to do a distance check between enemy and player. You can do this every half second or whatver, it doesn’t have to be a per frame sort of thing. So as soon as you are within range, start the attack and out of range, stop the attack.
Your setup could be a timer running in a loop, doing a distance check. Using a branch you can compare the current distance with a target distance, say 200 or whatever. As soon as current distance is less than 200 set your attack boolean to true. If it’s more than 200 set it to false. You can read that boolean value for your animation blueprint to activate the correct animation. Or if you are using montage, you can play or stop the attack animation based on the distance in stead of setting a boolean.
If you specifically wanted to use collision, then your setup will be very similar accept you’ll use OnOverlap and EndOverlap to set your boolean or call your montage. The reason I’d use distance is because it’s pretty much 100% reliable where collision could possibly fail, and if that happens, your animation does not start or stop. If it doesn’t start, it could possibly be acceptable, if it’s rare, but if it does not stop, it’s not good at all. You can test it out and you’ll see what works for you as you play test. Unforseen stuff pops up all the time during play testing.
Hope that makes sense. That’s the basic idea anyway…