# Crosshair not aligning with mouse position

**URL:** <https://forums.unrealengine.com/t/crosshair-not-aligning-with-mouse-position/876839>\
**Category:** UI\
**Tags:** unreal-engine, Widget, question\
**Created:** [April 7, 2023, 11:52pm UTC](https://forums.unrealengine.com/t/crosshair-not-aligning-with-mouse-position/876839 "2023-04-07T23:52:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathe\_Nove](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mathe\_Nove](https://forums.unrealengine.com/u/Mathe_Nove)\
**Post date:** [April 7, 2023, 11:52pm UTC](https://forums.unrealengine.com/t/crosshair-not-aligning-with-mouse-position/876839/1 "2023-04-07T23:52:27Z")

</div>

Hi there, first time posting a question here  
I’m creating a turrent game, the turrent aim where the mouse is and this part works fine but the crosshair does not follow the mouse fully.

I tried getting the mouse position and setting to the image but I get a strange offset  
(the line trace is where the mouse is)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/b/3dbafdf6f46bbce44f13a6bfbe15f8524eecb7e6.jpeg)

And this is the code  
(The “Get Mouse Position On ViewPort” Node give me the same result)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/9/ac9ce4fd00968068ed6f2f16552e5c08632b686e.png)

I tried setting the position of the line trace hit but then I get other problem

---

<div class="post-metadata">

**Author:** ![Ezeroz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ezeroz](https://forums.unrealengine.com/u/Ezeroz)\
**Post date:** [April 9, 2023, 11:08am UTC](https://forums.unrealengine.com/t/crosshair-not-aligning-with-mouse-position/876839/2 "2023-04-09T11:08:30Z")

</div>

I think you should try Get mouse position on Viewport instead of Get Mouse position. Hope it work!

---

<div class="post-metadata">

**Author:** ![Mathe\_Nove](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mathe\_Nove](https://forums.unrealengine.com/u/Mathe_Nove)\
**Post date:** [April 11, 2023, 2:23pm UTC](https://forums.unrealengine.com/t/crosshair-not-aligning-with-mouse-position/876839/3 "2023-04-11T14:23:29Z")

</div>

I have the same result
