Download

How to create a line between two points with distance IN-GAME Blueprint

Hello Everybody

I’m quite new with Unreal Engine so here is my question:

How can I create a blueprint that enables me to pick any two world points IN-GAME that creates an line between them, and also tells the distance of that line. I need an very detailed explanation if it is possible since I’m new to Blueprints (pictures would be very helpful). Looking forward to any response.

Thank You.

Create a blueprint class type of HUD and GameMode if you haven’t already.
Click on World Settings, make your newly created GameMode your default (overriden) GameMode.
Then from same panel, set your HUD blueprint as your default as well.
In HUD blueprint, “Event Receive Draw HUD” is where you want to draw your 2D stuff.
For getting the 2D screen location of a 3D position, you can use the “Project World Location to Widget Position” node.
Also as you can see, it is best if you apply (multiply actually) your viewport scale to get the correct 2D point on your screen.

Good luck.

Draw02.png&stc=1&d=1461605896

&stc=1&d=1461605886