How does the GUI distance works in the "Blueprint HUD example"?

Mainly the part that is shown in the box but a general explanation would help a ton as well thanks

The box is simply asking “Does this object exist?” or… well… “Is it valid?”.

The rest is mainly responsible to calculate the distance to that object which determines the size of the text and the position…

This video might help you:

That doesn’t explain the currentobjective at all.

I’m not sure how this is even made because alt dragging it to make a copy doesn’t even give the distance feature.

Then you might want to ask where this node comes from since it is not specific to the “Is Valid” node which you marked.

Anyway by right clicking and clicking on “Find Variable References” you get a list of all places this variable is used.

The first result you see will be a “Set Current objective” which (if you doubleclick it) brings you to an custom event triggered by BPI_HUD_Interface_Events.

And this can be called from pretty much anywhere. In this example it is done static via the LevelBlueprint directly giving the Pickup as input.