Auto Aim based on a distance

Hi There,

I am trying to make an Auto aim system based on distance and enemy tag…
So that when I press and hold right mouse button, it selects the closest enemy with the tag and aims at it.

I have made a Closest Actor float that is set to 5000 but I dont know the nodes that I would need to calculate the distance?

Any help would be amazing.

Here is the code I have right now.

[Simple aim code posted by mawilbolou | blueprintUE | PasteBin For Unreal Engine 4

](Simple aim code posted by mawilbolou | blueprintUE | PasteBin For Unreal Engine 4)