# Making player head rotate to the direction the camera is facing

**URL:** <https://forums.unrealengine.com/t/making-player-head-rotate-to-the-direction-the-camera-is-facing/1470099>\
**Category:** Character & Animation\
**Tags:** forward-vector, rotation, unreal-engine, vector, question, Blueprint\
**Created:** [December 4, 2023, 2:07pm UTC](https://forums.unrealengine.com/t/making-player-head-rotate-to-the-direction-the-camera-is-facing/1470099 "2023-12-04T14:07:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianWickstr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChristianWickstr](https://forums.unrealengine.com/u/ChristianWickstr)\
**Post date:** [December 4, 2023, 2:07pm UTC](https://forums.unrealengine.com/t/making-player-head-rotate-to-the-direction-the-camera-is-facing/1470099/1 "2023-12-04T14:07:26Z")

</div>

I want to rotate the player’s head to the direction the camera is facing. How can I take account for the forward vector when I rotate the head? I have tried “Rotation From X Vector” and other solutions, but I’m stuck.

These are the nodes in the animation blueprint:

 ![Screenshot 2023-12-04 015638](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/f/79f46cf5de063806123171b15766d674a9674e91.png)  
 ![Screenshot 2023-12-04 015707](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/e/74e1a1e059897a752fa87008eb0eeee8a1493775.png)

This is how I want the head to rotate according to the direction the camera is facing:

 ![Screenshot 2023-12-04 020128](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/f/d5f93e7050e33e6c0cec97b07068a02f63017fdb.png)

This is what happens when the player is facing in the opposite direction. The head turns when it should look in the same direction as the camera:

 ![Screenshot 2023-12-04 020212](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/a/38adb0ec52caeafa509e58e09e94ab4840417d66.png)

---

<div class="post-metadata">

**Author:** ![MostHost\_LA](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mosthost_la/32/907035_2.png) [@MostHost\_LA](https://forums.unrealengine.com/u/MostHost_LA)\
**Post date:** [December 5, 2023, 12:11am UTC](https://forums.unrealengine.com/t/making-player-head-rotate-to-the-direction-the-camera-is-facing/1470099/2 "2023-12-05T00:11:52Z")

</div>

Use an aim offset.

And camera forward vector normalized, broken, take y.

From that, the value is always in a 0 to 1 range.  
So your AO can probably use 0 and 1 directly.  
That’s assuming you want 180deg.

Neg numbers should be the back/opposite of what you need.

Its possible that the front is actually in a different range depending on what you get the forward vector of.  
If it gives you - values on the left and positive to the right, just set your AO to -.5 .5 range - instead of doing math.  
(You could add .5, and then always have a value from 0 to 1. But its a needless expense).

Also,  
The abimation blueprint is not supposed to have _any_ code.  
Do everything from the characterBP.

---

<div class="post-metadata">

**Author:** ![ChristianWickstr](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChristianWickstr](https://forums.unrealengine.com/u/ChristianWickstr)\
**Post date:** [December 5, 2023, 12:38am UTC](https://forums.unrealengine.com/t/making-player-head-rotate-to-the-direction-the-camera-is-facing/1470099/3 "2023-12-05T00:38:46Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 4, 2024, 12:39am UTC](https://forums.unrealengine.com/t/making-player-head-rotate-to-the-direction-the-camera-is-facing/1470099/4 "2024-01-04T00:39:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
