# How to create a line between a world space objective marker and a screen-based UI element

**URL:** <https://forums.unrealengine.com/t/how-to-create-a-line-between-a-world-space-objective-marker-and-a-screen-based-ui-element/1214313>\
**Category:** UI\
**Tags:** Blueprints-Programming, unreal-engine, UI, question\
**Created:** [June 29, 2023, 11:45am UTC](https://forums.unrealengine.com/t/how-to-create-a-line-between-a-world-space-objective-marker-and-a-screen-based-ui-element/1214313 "2023-06-29T11:45:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shez32](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shez32](https://forums.unrealengine.com/u/Shez32)\
**Post date:** [June 29, 2023, 11:45am UTC](https://forums.unrealengine.com/t/how-to-create-a-line-between-a-world-space-objective-marker-and-a-screen-based-ui-element/1214313/1 "2023-06-29T11:45:32Z")

</div>

![ss](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/2/d/32dd0f6a6f10f9970e299f573a841f73a168532f.jpeg)  
How can I draw a line between a world space objective marker and a screen-based UI element, similar to what’s shown in the screenshot.

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [June 29, 2023, 12:43pm UTC](https://forums.unrealengine.com/t/how-to-create-a-line-between-a-world-space-objective-marker-and-a-screen-based-ui-element/1214313/2 "2023-06-29T12:43:57Z")

</div>

Override the `OnPaint` function in your widget, it will provide you with `Context`;  
There, you can `Draw Line` using that `Context` as one of the inputs.

To get the end point, you can use the `Project World to Screen` node.
