# Can't get widget correct screen position

**URL:** <https://forums.unrealengine.com/t/cant-get-widget-correct-screen-position/2310507>\
**Category:** UI\
**Tags:** unreal-engine, question, CPP\
**Created:** [January 30, 2025, 3:56pm UTC](https://forums.unrealengine.com/t/cant-get-widget-correct-screen-position/2310507 "2025-01-30T15:56:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![duppah\_meamnim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@duppah\_meamnim](https://forums.unrealengine.com/u/duppah_meamnim)\
**Post date:** [January 30, 2025, 3:56pm UTC](https://forums.unrealengine.com/t/cant-get-widget-correct-screen-position/2310507/1 "2025-01-30T15:56:27Z")

</div>

No matter what I do cannot get the correct screen position of the widget.  
I check if it is correct by subtracting the MousePosition.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/2/3021724657e0bfa411f03fe3c130d8c668b8bdd7.png)

This snippet is just an example for things I have tried already… but no matter what I do the ScreenPosition of the widget is incorrect when scaling the viewport.

---

<div class="post-metadata">

**Author:** ![duppah\_meamnim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@duppah\_meamnim](https://forums.unrealengine.com/u/duppah_meamnim)\
**Post date:** [January 30, 2025, 5:11pm UTC](https://forums.unrealengine.com/t/cant-get-widget-correct-screen-position/2310507/2 "2025-01-30T17:11:30Z")

</div>

For anyone viewing this in the future, you need to multiply the mouse by the viewport scale as well.

---

<div class="post-metadata">

**Author:** ![duppah\_meamnim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@duppah\_meamnim](https://forums.unrealengine.com/u/duppah_meamnim)\
**Post date:** [February 12, 2025, 2:00pm UTC](https://forums.unrealengine.com/t/cant-get-widget-correct-screen-position/2310507/3 "2025-02-12T14:00:59Z")

</div>

This is a lie btw, I used the screen space node in a material to get it to work.  
I couldn’t make it work purely by cpp…

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [March 14, 2025, 2:01pm UTC](https://forums.unrealengine.com/t/cant-get-widget-correct-screen-position/2310507/4 "2025-03-14T14:01:51Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
