# UMG location to widget position not projecting

**URL:** <https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630>\
**Category:** UI\
**Tags:** project-world-locati, unreal-engine, Widget, UE4, question, Blueprint, UMG\
**Created:** [February 7, 2018, 4:41am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630 "2018-02-07T04:41:31Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 4:41am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/1 "2018-02-07T04:41:31Z")

</div>

Hey i’m trying to get a hit from a trace to determine where the crosshair will be for my musket.

 ![229821-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/6/5967393a92b314b6b8effd17a96c62798b351fdf.png)

Really just want gun that has its crosshair move based on where the muzzle is pointing.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 4:53am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/2 "2018-02-07T04:53:24Z")

</div>

Not sure about that Project node. You could try this one instead [Project World to Screen](https://docs.unrealengine.com/latest/INT/BlueprintAPI/Utilities/ProjectWorldtoScreen/).

And your location variable is named “MuzzleDirection” so I want to be clear that you don’t want to give it a direction vector, you want to give it the world location of the termination point of the trace.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 4:56am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/3 "2018-02-07T04:56:02Z")

</div>

Oh, the one you’re using handles scaling. Seems like it should work. I guess make sure the input location is good.

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 4:58am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/4 "2018-02-07T04:58:07Z")

</div>

didn’t work 😕 and ya it contains the location of where the trace hit

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 5:02am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/5 "2018-02-07T05:02:38Z")

</div>

the node just wont turn the location variable into screen data for my set position function to use.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 5:08am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/6 "2018-02-07T05:08:55Z")

</div>

I see it’s online multiplayer. Are you sure you’re calling this on the owning client?

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 5:10am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/7 "2018-02-07T05:10:30Z")

</div>

![229822-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/d/48d49d69230d61c0b681d8f801a044f441de5c7d.png)

looks like it right?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 5:17am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/8 "2018-02-07T05:17:49Z")

</div>

Oh it’s in the widget, duh. Yeah that’s client only.

You can get the controller directly from the pawn. Why use the player ID?

And is the PrintString saying the return value is true?

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 5:19am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/9 "2018-02-07T05:19:46Z")

</div>

Nope it says false.

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 5:22am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/10 "2018-02-07T05:22:19Z")

</div>

actually when i go and do this

![229823-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/3/c/d3c74df6e4b02dc2c1398fed7e16b3e7a8d4a585.png)

it says that 1 player is true but i cant see the widget

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 5:26am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/11 "2018-02-07T05:26:40Z")

</div>

Drag off the CastTo output pin and add the GetController node and feed it into the project node.

If it still says false then that means the world location isn’t visible given the camera’s location and rotation (aspect ratio and FOV too I guess).

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 5:33am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/12 "2018-02-07T05:33:22Z")

</div>

Can’t plug in player controller. Not compatible with player controller ref.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 5:37am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/13 "2018-02-07T05:37:39Z")

</div>

Cast the GetController output to PlayerController first. Forgot that part.

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 5:40am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/14 "2018-02-07T05:40:43Z")

</div>

how do i cast it into player controller?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 5:44am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/15 "2018-02-07T05:44:28Z")

</div>

Drag off the output pin of GetController and type “cast to player controller” and it should come up before you’re done typing.

---

<div class="post-metadata">

**Author:** ![MikeBur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MikeBur](https://forums.unrealengine.com/u/MikeBur)\
**Post date:** [February 7, 2018, 5:47am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/16 "2018-02-07T05:47:20Z")

</div>

FIXED!!! thank you so much for helping me through this.

 ![229825-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/a/b5a7e776316604ffe13012579fca7fa619061bc1.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 5:53am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/17 "2018-02-07T05:53:51Z")

</div>

That’s not what I suggested – I didn’t know about that node – but I’ll take the credit. 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_49a519741](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_49a519741](https://forums.unrealengine.com/u/anonymous_user_49a519741)\
**Post date:** [February 7, 2018, 6:11am UTC](https://forums.unrealengine.com/t/umg-location-to-widget-position-not-projecting/416630/18 "2018-02-07T06:11:22Z")

</div>

Just to be clear, this is what I was suggesting – but getting the controller directly like you are is better.

 ![229816-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/4/1546a4e94922846f129fb4aac43eb11b58512c9c.png)
