# Convert World Location to Screen Location bug ?

**URL:** <https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [March 2, 2015, 8:50pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421 "2015-03-02T20:50:19Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_18d0a9f2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_18d0a9f2](https://forums.unrealengine.com/u/anonymous_user_18d0a9f2)\
**Post date:** [March 2, 2015, 8:50pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/1 "2015-03-02T20:50:19Z")

</div>

Hello everyone,

In my third person shooter, I 'd like to display a dynamic crossair. My problem is that it is not displayed at the right location, there seems to be some constant offset between where the real location and where it is actually displayed. The node Convert World Location to Screen Location seems to be buggy… Is it a known issue?

I work with UE4.6.

Thanks !

---

<div class="post-metadata">

**Author:** ![Zhi\_Kang\_Shao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zhi\_Kang\_Shao](https://forums.unrealengine.com/u/Zhi_Kang_Shao)\
**Post date:** [March 2, 2015, 9:54pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/2 "2015-03-02T21:54:04Z")

</div>

Since you’re talking about a constant offset, could it be that the crosshair’s anchor point is placed at the screen location, instead of the center? Perhaps setting the anchor point to the image’s center makes a difference:  
 ![alignment.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/1/91c97e8742060b42396230df48842a6d2e4e1bd4.png)

If thats not the case, could you provide a screenshot of how it looks?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_18d0a9f2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_18d0a9f2](https://forums.unrealengine.com/u/anonymous_user_18d0a9f2)\
**Post date:** [March 2, 2015, 11:05pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/3 "2015-03-02T23:05:34Z")

</div>

Here’s a screenshot.

 ![screen.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/e/2e68a8045f0e8ec1eeff090a5dcda4d82c5aab54.png)

In 4.7, the same nodes work and my dynamic crossair looks good. Unfortunately, I can’t upgrade to 4.7 …

---

<div class="post-metadata">

**Author:** ![Zhi\_Kang\_Shao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zhi\_Kang\_Shao](https://forums.unrealengine.com/u/Zhi_Kang_Shao)\
**Post date:** [March 3, 2015, 2:41pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/4 "2015-03-03T14:41:41Z")

</div>

Ah, it doesn’t seem to be the crosshair image’s anchor then. I’m afraid I can’t think of anything else right now.

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [March 3, 2015, 9:19pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/5 "2015-03-03T21:19:56Z")

</div>

Are you running the game in Fullscreen? The Projection doesn’t seem to factor in the current windows size right now. If you go Fullscreen, you might see it move location.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_66a0fcb6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_66a0fcb6](https://forums.unrealengine.com/u/anonymous_user_66a0fcb6)\
**Post date:** [March 6, 2015, 2:08am UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/6 "2015-03-06T02:08:15Z")

</div>

Hey, I have the same problem. I have some UMG widgets that will go left and up. I think this started once I launched my game on Android. There’s a thread about this on the answer hub but I wasn’t able to find the file they were talking about:

> **[Offset in Convert World Location to Screen Location](https://forums.unrealengine.com/questions/145354/offset-in-convert-world-location-to-screen-locatio.html)**
>
> There seems to be a strange bug on our designer’s machine (only) that causes the above convert function to report values that are offset up and to the left. We’re using this call to draw some reticle targeting widgets over some of our characters. ...

---

<div class="post-metadata">

**Author:** ![Zhi\_Kang\_Shao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zhi\_Kang\_Shao](https://forums.unrealengine.com/u/Zhi_Kang_Shao)\
**Post date:** [March 27, 2015, 7:35pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/7 "2015-03-27T19:35:07Z")

</div>

I had a similar problem just now and found my solution somewhere else on this forum. Posting here because I remembered this thread.

**Stuckbug** mentioned [here](https://forums.unrealengine.com/showthread.php?50130-UMG-Tutorial-Placing-Widgets-Over-Actors-In-Screenspace):

> [@](#):
>
> Based on the screenshot, it looks like maybe your editor kicked in scalability settings? I’ve noticed that world to screen functions get messed up if the editor does a resolution scale, which can happen automatically during times of poor performance.

Setting the resolution scale to 100% solved the issue for me:  
 ![reso_scale.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/1/481f3b7d9e21ff0efbc0fce5b3e78caf5224d806.png)

Maybe this works for you guys as well.

---

<div class="post-metadata">

**Author:** ![NickDarnell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NickDarnell](https://forums.unrealengine.com/u/NickDarnell)\
**Post date:** [March 27, 2015, 8:12pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/8 "2015-03-27T20:12:16Z")

</div>

ConvertWorldLocationToScreenLocation predates UMG, it’s only designed to give you correct screen locations if you’re using it for screen related things that map directly to the game’s resolution, like AHUD/Canvas.

UMG/Slate do not exist in the same 2D unit space as the rest of the game. The game’s resolution scale is one source of that difference, another is DPI scale. If a DPI scale has been applied, you still need to transform that “Screen Location” which is in Resolution Scaled, and non-DPI space, into the space of widgets if you plan to use it with UMG. There’s a couple of utility functions that might be in 4.6, UWidgetLayoutLibrary::GetViewportScale, which if you applied the inverse of, after applying the inverse resolution quality, you’d arrive at the proper position for UMG for fullscreen UI.

If you’d like to grab from GitHub, I’ve added a utility for 4.8 to make this task easier, it’s UWidgetLayoutLibrary::ProjectWorldLocationToWidgetPosition.

---

<div class="post-metadata">

**Author:** ![Zhi\_Kang\_Shao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zhi\_Kang\_Shao](https://forums.unrealengine.com/u/Zhi_Kang_Shao)\
**Post date:** [April 2, 2015, 5:32pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/9 "2015-04-02T17:32:33Z")

</div>

> [@](#):
>
> If you’d like to grab from GitHub, I’ve added a utility for 4.8 to make this task easier, it’s UWidgetLayoutLibrary::ProjectWorldLocationToWidgetPosition.

That sounds great Nick! Would you say this is the intended way to position widgets over actors?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_d9331107](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d9331107](https://forums.unrealengine.com/u/anonymous_user_d9331107)\
**Post date:** [April 12, 2015, 4:05pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/10 "2015-04-12T16:05:11Z")

</div>

I know the above explanation is better, but if anyone reading this don’t feel like grabbing 4.8 from GitHub, you can just multiply the output “Screen Location” by viewportscale to the power of negative 1, like so:

![153a02ed525e09d55ea5edf1088389cefed67e0a.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/3/153a02ed525e09d55ea5edf1088389cefed67e0a.jpeg)

I am not sure whether this has other consequences further down the line, but so far it seems to work for me.

---

<div class="post-metadata">

**Author:** ![Ryan\_Darcey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ryan\_Darcey](https://forums.unrealengine.com/u/Ryan_Darcey)\
**Post date:** [April 14, 2016, 5:55pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/11 "2016-04-14T17:55:43Z")

</div>

That worked perfectly for me, mrzapp!!! Thanks!

---

<div class="post-metadata">

**Author:** ![AmareshB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/amareshb/32/852526_2.png) [@AmareshB](https://forums.unrealengine.com/u/AmareshB)\
**Post date:** [April 23, 2016, 1:19pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/12 "2016-04-23T13:19:41Z")

</div>

> [@mrzapp;270163](#):
>
> I know the above explanation is better, but if anyone reading this don’t feel like grabbing 4.8 from GitHub, you can just multiply the output “Screen Location” by viewportscale to the power of negative 1, like so:
> 
> ![153a02ed525e09d55ea5edf1088389cefed67e0a.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/3/153a02ed525e09d55ea5edf1088389cefed67e0a.jpeg)
> 
> I am not sure whether this has other consequences further down the line, but so far it seems to work for me.

This worked for me perfectly. Thanks for your solution.

Cheers.

---

<div class="post-metadata">

**Author:** ![Kagurox](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kagurox](https://forums.unrealengine.com/u/Kagurox)\
**Post date:** [May 11, 2016, 5:49pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/13 "2016-05-11T17:49:24Z")

</div>

Thanks mrzapp! Works great and helped me out a lot!

---

<div class="post-metadata">

**Author:** ![Invius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Invius](https://forums.unrealengine.com/u/Invius)\
**Post date:** [May 9, 2018, 1:26pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/14 "2018-05-09T13:26:32Z")

</div>

My god!!! This helped me alot on my multiplayer splitscreen game!!!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_60d28b4b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_60d28b4b](https://forums.unrealengine.com/u/anonymous_user_60d28b4b)\
**Post date:** [July 23, 2020, 3:56pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/15 "2020-07-23T15:56:11Z")

</div>

> [@mrzapp](#):
>
> I know the above explanation is better, but if anyone reading this don’t feel like grabbing 4.8 from GitHub, you can just multiply the output “Screen Location” by viewportscale to the power of negative 1, like so:
> 
> ![153a02ed525e09d55ea5edf1088389cefed67e0a.jpeg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/3/153a02ed525e09d55ea5edf1088389cefed67e0a.jpeg)
> 
> I am not sure whether this has other consequences further down the line, but so far it seems to work for me.

This is exacly what i needed, Thank you!

---

<div class="post-metadata">

**Author:** ![Helskor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/helskor/32/899726_2.png) [@Helskor](https://forums.unrealengine.com/u/Helskor)\
**Post date:** [March 28, 2021, 1:44am UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/16 "2021-03-28T01:44:18Z")

</div>

Old post, but still comes up in searches for this issues  
There is a different function that takes scaling into consideration: **Project World Location to Widget Position** ]([Project World Location to Widget Position | Unreal Engine Documentation](https://docs.unrealengine.com/en-US/BlueprintAPI/Viewport/ProjectWorldLocationtoWidgetPosi-/index.html))

---

<div class="post-metadata">

**Author:** ![BojanglesTheLess](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BojanglesTheLess](https://forums.unrealengine.com/u/BojanglesTheLess)\
**Post date:** [March 10, 2023, 4:18pm UTC](https://forums.unrealengine.com/t/convert-world-location-to-screen-location-bug/22421/17 "2023-03-10T16:18:57Z")

</div>

indeed it does! thanks for posting!
