Check the next links. They should give you an idea how to do it:
https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/UseRaycasts/Blueprints/index.html
https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/Transformation/GetDistanceTo/index.html