# How to rotate pawn using mouse in #UE4

**URL:** <https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE4, Blueprint, question\
**Created:** [August 19, 2022, 7:03am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567 "2022-08-19T07:03:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 19, 2022, 7:03am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/1 "2022-08-19T07:03:07Z")

</div>

I’m new to unreal engine and learning blueprint and basic stuff.  
how can i rotate pawn using mouse .  
what will be blueprint

 ![1660820050235](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/3/d/03d6c323db85c418902078a3b1c332ad5edd6ef5.jpeg)

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [August 19, 2022, 7:14am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/2 "2022-08-19T07:14:35Z")

</div>

Hey there @anonymous_user_dd7783e2! Welcome to the community! So it’ll vary pretty wildly depening on what type of character you have. If you’re working with a 3rd person or top down character, these 2 posts should get you started!

The blueprint:

> [@How to allow a 3rd person character to face where the mouse is aiming](https://forums.unrealengine.com/t/how-to-allow-a-3rd-person-character-to-face-where-the-mouse-is-aiming/277885/3):
>
> Simply put your character as the Target for “Get Actor Location” and “Set Actor Rotation” and it will look at wherever your mouse is! I tested this as well to make sure it works. If you don’t want debug lines to draw, then change the “Draw Debug Type” under “Single Line Trace for Objects” to “None”. As well, this Blueprint will only look at Static geometry (BSP brushes, etc.), so you may want to add more types to the “Make Array” node. Just click “Add pin” and select all o…

Helpful adjustment in the comments:

> [@How to allow a 3rd person character to face where the mouse is aiming](https://forums.unrealengine.com/t/how-to-allow-a-3rd-person-character-to-face-where-the-mouse-is-aiming/277885/6):
>
> Thanks so much! BUT… with my top down shooter game (WASD to move north, south, east, west) I needed the player to always face where the mouse was. This blueprint Parralex provided was a great solution! I had to add one more thing… a Break Rot and a Make Rot. This is because with the character would become inverted when mousing over tall objects. SOOOOO, Here is what I did to fix this! Hope it helps someone!

If that’s not what you’re looking for, let me know!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 19, 2022, 7:56am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/3 "2022-08-19T07:56:02Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/2/9b2ff6cf1371984f5c8712e428d3e6acbb832920.jpeg)

I bet this is how it looked like back in the day when Tim & the Team were designing the blueprints system. 💌

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 19, 2022, 8:21am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/4 "2022-08-19T08:21:58Z")

</div>

This is of third person movement using mouse…!

i’m looking for solution of rotation of pawn using mouse #programming-scripting:blueprint

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 19, 2022, 8:29am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/5 "2022-08-19T08:29:56Z")

</div>

The question is too generic and vague and has a dozen answers. We don’t know _how_ you want to rotate. It can be as easy as ticking a single box:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/4/304bdafc553b76395c31e2291314d16cb59ab82d.png)

Or as complicated as you want to make it. If you want a very specific behaviour, you’d need to disclose more details. We don’t even know if you’re working with a template or designing stuff from scratch!

* * *

For a completely blank pawn, it could look like so:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/5/1/5518001fbfce86ca8a4da92f5db4f09f2da60918.png)

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [August 19, 2022, 8:50am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/6 "2022-08-19T08:50:35Z")

</div>

That’s actually just for rotation assuming you were just trying to look at the mouse, ideal for 3rd person or top down characters you want to always look at the mouse. If you’re trying to turn a 3rd person player like in @Everynone’s example, you can use that code or take a look at the 3rd person template project.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 19, 2022, 10:14am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/8 "2022-08-19T10:14:30Z")

</div>

i’m trying to  
as play begin , player drag the object and rotate the object using the mouse …  
how that can be implemented in blueprint…  
i have written c++ code for it…  
unable to attach here

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 19, 2022, 10:19am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/9 "2022-08-19T10:19:01Z")

</div>

> how can i rotate pawn using mouse

vs

> player drag the object and rotate the object using the mouse …

These seem to be 2 different things you’re asking about. Is this what you’re trying to do - inspect an object? As in:

> [@Rotate an object in all directions using the mouse](https://forums.unrealengine.com/t/rotate-an-object-in-all-directions-using-the-mouse/463545/2):
>
> Rotating an object is rather straighforward: [[Image from Gyazo]](https://gyazo.com/f1e0aae3a4e579adf7cb83323e43e9a1) After that, the user needs to be able to click on certain areas of the object Child Actors Components sound like the most obvious solution if the attached elements need to define their own unique logic. Depending on what is required (complexity of the shape of the object, modularity, scope) you could have sockets on a static mesh and add Child Actors Components procedurally. I can’t use the default templa…

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 22, 2022, 5:28am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/10 "2022-08-22T05:28:14Z")

</div>

not to inspect an object.  
first check the condition whether the mouse is press or not … then to select the object then as mouse changes its axis then same time the object rotate too…  
want to implement this problem in blueprint

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 22, 2022, 5:32am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/11 "2022-08-22T05:32:00Z")

</div>

On Left click, get hit under cursor for objects, store reference, use the reference to add rotation using MouseX.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 22, 2022, 5:37am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/12 "2022-08-22T05:37:36Z")

</div>

![1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/7/46752b31dd9f6e5809c8c986bd1400d0483c7371.jpeg)  
will this blueprint work

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 22, 2022, 5:38am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/13 "2022-08-22T05:38:04Z")

</div>

No. I’ll post an example in a bit.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 22, 2022, 5:47am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/14 "2022-08-22T05:47:09Z")

</div>

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

See if you can get it to work this way; hope I got it right.

* * *

You can validate the get node like so, btw:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/d/8/cd8239e6a36ffd329eb966af60a83880e70bdaed.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 22, 2022, 5:54am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/15 "2022-08-22T05:54:09Z")

</div>

I appreciate your time and for help…  
one more question .  
does not here play role of event tick function?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 22, 2022, 6:01am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/16 "2022-08-22T06:01:07Z")

</div>

> [@anonymous\_user\_dd7783e2](#):
>
> does not here play role of event tick function?

Good question. `MouseX` polls every frame, just like Tick. If you ever create an `AxisMapping`, it will also work just like Tick - executing every frame:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/b/5cbbb3f80d0e45cebe919b614f940791bab53abf.png)

* * *

If you scripted it like so:

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

The result would be identical but you’d need 5 nodes instead of 4. The horror! ;p

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 22, 2022, 6:08am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/17 "2022-08-22T06:08:39Z")

</div>

@Everynone you are HERO…!  
thnx for clarification

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dd7783e2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dd7783e2](https://forums.unrealengine.com/u/anonymous_user_dd7783e2)\
**Post date:** [August 22, 2022, 6:39am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/18 "2022-08-22T06:39:30Z")

</div>

![Screenshot 2022-08-22 120919](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/3/8/2381593f963c35ff8f475406221827395d6af4eb.png)  
what here GET part do?  
is it like getting input of mouse and validating it?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 22, 2022, 6:58am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/19 "2022-08-22T06:58:14Z")

</div>

I’m showing a picture of how to do it above. Alternatively you could:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/8/c28be446e8127bcc7878972249ac5452eb58dc52.png)

But then we’re up to 6 nodes! 😇

---

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [August 22, 2022, 7:23am UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/20 "2022-08-22T07:23:28Z")

</div>

Yes but when searching blueprints this will be easily readable on the “Find” panel while a validated getter does not.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [August 22, 2022, 1:29pm UTC](https://forums.unrealengine.com/t/how-to-rotate-pawn-using-mouse-in-ue4/631567/21 "2022-08-22T13:29:54Z")

</div>

Ah, bummer! Didn’t know that:

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

But, this seems to work OK:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/4/88452a451d58a6aa8d6905f129bace4d631b7fcb.png)
