I managed to solve the distance problem the following way:
I created a function in my “BP_ActionItemClick” called “GetDistanceTo”:
I called the “GetDistanceTo” function in my “BP_ActionItemClick” like that:
And it does work perfectly.
However, in the beginning, I tried to create the “GetDistanceTo” function in a new actor component blueprint to make it reusable. When I created the same function (let’s call it “Get Dist” here) in a new blueprint, it looks like that:
but when I import it into the “BP_ActionItemClick”, it doesn’t work.
It says that I have to connect something to “Target [self],” but I can’t connect anything to “Target [self]”. So what am I doing wrong?