# Mouse Hit location

**URL:** <https://forums.unrealengine.com/t/mouse-hit-location/613573>\
**Category:** Blueprint\
**Tags:** UE4-25, unreal-engine, UE5-0, Blueprint, question\
**Created:** [July 25, 2022, 6:52am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573 "2022-07-25T06:52:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukaoooo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lukaoooo](https://forums.unrealengine.com/u/lukaoooo)\
**Post date:** [July 25, 2022, 6:52am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/1 "2022-07-25T06:52:53Z")

</div>

hello, I managed to make my character rotate with the location of the mouse, it works well, it only works if it is hitting an object, when it doesn’t hit the rotation to, how could I rotate the character perfectly even when it doesn’t hit?

 ![Captura de tela 2022-07-25 034553](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/0/870d1788e874847087c67a7df5384bba0423537f.png)  
 ![Captura de tela 2022-07-25 034635](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/0/4/80446772a4b7732964952fdc6ef9fc2e4842b600.png)  
 ![Captura de tela 2022-07-25 034718](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/0/4d06ef20d62b6848c9f03e7fe05d7728b77b692b.png)

---

<div class="post-metadata">

**Author:** ![NessaChen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NessaChen](https://forums.unrealengine.com/u/NessaChen)\
**Post date:** [July 25, 2022, 7:47am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/2 "2022-07-25T07:47:34Z")

</div>

Try using DeprojectScreenToWorld node to make your character look at the location of your cursor instead of it’s trace hit location.  
Like this:

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

---

<div class="post-metadata">

**Author:** ![dorusoftware](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dorusoftware](https://forums.unrealengine.com/u/dorusoftware)\
**Post date:** [July 25, 2022, 8:46am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/3 "2022-07-25T08:46:30Z")

</div>

there is nothing in the world where you try to hit with the mouse. It will not find anything

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [July 25, 2022, 1:49pm UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/4 "2022-07-25T13:49:03Z")

</div>

Try this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/7/af74eed10fbba6cb2691ed6816e2004906ed0edf.png)

![MouseProjectPawn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/c/61c902ee32e53c1475f69dac48094054a0f3c207.gif)

---

<div class="post-metadata">

**Author:** ![lukaoooo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lukaoooo](https://forums.unrealengine.com/u/lukaoooo)\
**Post date:** [July 26, 2022, 2:25am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/5 "2022-07-26T02:25:12Z")

</div>

Hi, I couldn’t reproduce this  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/3/363462f9bb848842b9d43e73e7b23692854579d3.png)

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [July 26, 2022, 2:29am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/6 "2022-07-26T02:29:02Z")

</div>

It’s a [Math Expression node](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/MathNode/).

You can create it by right clicking and searching for it. Press F2 to type ( as if renaming the node ).

---

<div class="post-metadata">

**Author:** ![lukaoooo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lukaoooo](https://forums.unrealengine.com/u/lukaoooo)\
**Post date:** [July 26, 2022, 3:05am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/7 "2022-07-26T03:05:13Z")

</div>

thank you so much

---

<div class="post-metadata">

**Author:** ![lukaoooo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lukaoooo](https://forums.unrealengine.com/u/lukaoooo)\
**Post date:** [July 26, 2022, 3:34am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/8 "2022-07-26T03:34:04Z")

</div>

something strange happens, at the bottom of the screen it works fine, when it’s above it doesn’t return any value

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/3/64325596675b6dac0ebef8ad7f7e3f1151cc0b12.jpeg)

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [July 26, 2022, 3:36am UTC](https://forums.unrealengine.com/t/mouse-hit-location/613573/9 "2022-07-26T03:36:55Z")

</div>

Try increasing the TraceLength.
