How can I make the character I am controlling attack when clicking an enemy in a game with MOBA-style controls?

The problem is you plugged in the enemy.but didn’t take it out to use.

and the variable name is kind of confusing…I would name them like ,target enemy,target player,selected enemy,etc.