Diablo Style Click To Attack

Hi guys,

Been looking around a lot for a way of doing this on the Top Down sample, where if I click on an enemy it will move to the enemy and attack - and if I click on the terrain it will just move to the mouse location on the terrain - but can’t seem to find anything (or maybe I’m just misunderstanding answers).

Basically the end result of what I want is when I hover over an enemy, a health bar will appear on the screen, and when I click on that enemy, I’ll move to attack it.

I’ve got a hit result to print what I click on, which differentiates between the different objects (so if I click enemy, it prints “enemy” and if I click on any of the terrain it prints the name of that block) but getting the function to move if not enemy, and move and attack if enemy is killing my brain.

Any help would be hugely appreciated!

Hello,

How about dealing with that like if your player was an AI,

I would set multiple branch to check one after another your actor classe.

Like is Ennemy : True → MoveTO // On Success Once destination (actor) is reached Play Anim montage Attack
False : Is actor = Block True : Simple MoveTo.

Regards,Gl