Player attacking all enemies at once

got it, but what do you suggest? and what can i use to replace the foreach loop there in the ‘on component end overlap’ event?