Is this a correct way of using a blueprint interface?

Hi! For my game I stumbled upon an issue when my player slashed at an enemy. I eventually did a really crappy workaround where I made a variable called “Attacking” and made it true for 1/10th of a second, and if the player overlapped the enemy while slashing and that variable was true then it ran the hurt/hit function.

So what I did recently was create an interface called “Attacking” and implemented it onto the player and all the enemies. Inside I placed a function called “Slashing”. In the slash event for the player I made it so that it fired that function for every actor that has it implemented, and then inside of the enemy’s bp it would check if the player is within range, and if it is then do the hurt/hit.

Would this be a correct way of using an interface? Is this any costly? The reason why I didn’t have the player just cast to the enemy and fire the hit event manually is for a few reasons, but I think that’s besides the point :slight_smile:

Thank you!