# How to Set the Actor rotation to Yaw in C++?

**URL:** <https://forums.unrealengine.com/t/how-to-set-the-actor-rotation-to-yaw-in-c/547082>\
**Category:** C++\
**Tags:** UE4-20, unreal-engine, UE4, CPP, question\
**Created:** [May 2, 2022, 9:46pm UTC](https://forums.unrealengine.com/t/how-to-set-the-actor-rotation-to-yaw-in-c/547082 "2022-05-02T21:46:55Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [May 3, 2022, 1:47am UTC](https://forums.unrealengine.com/t/how-to-set-the-actor-rotation-to-yaw-in-c/547082/21 "2022-05-03T01:47:40Z")

</div>

didn’t tried till now, will let you know if it works for me

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [May 3, 2022, 1:55am UTC](https://forums.unrealengine.com/t/how-to-set-the-actor-rotation-to-yaw-in-c/547082/22 "2022-05-03T01:55:05Z")

</div>

yes, this worked and just needed a little modification due to the engine syntax, I am using the old one v4.20, the most stable and not buggy.

`GetControllerRotation` is undefined for me, and G`etControlRotation` did the job.

`SetActorRotation(FRotator(0, GetControlRotation().Yaw, 0));`

Thank You for sharing the knowledge and helping me in my study process.

---

<div class="post-metadata">

**Author:** ![Gankable](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gankable](https://forums.unrealengine.com/u/Gankable)\
**Post date:** [May 3, 2022, 2:00am UTC](https://forums.unrealengine.com/t/how-to-set-the-actor-rotation-to-yaw-in-c/547082/23 "2022-05-03T02:00:17Z")

</div>

Oh awesome! I’m just learning myself and so I don’t mind using the bleeding edge buggy stuff for learning only. 😛  
(Though that was not an version issue, that was a typo on my part :P)  
It’s also GetControlRotation for me too… WHOOPS! hehe.  
I edited the original post in case others find it useful without the typos 😛  
I’m glad you were able to get it working! Good luck on your journey! See ya around.

---

<div class="post-metadata">

**Author:** ![Alexa.Ki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/alexa.ki/32/562753_2.png) [@Alexa.Ki](https://forums.unrealengine.com/u/Alexa.Ki)\
**Post date:** [May 3, 2022, 2:03am UTC](https://forums.unrealengine.com/t/how-to-set-the-actor-rotation-to-yaw-in-c/547082/24 "2022-05-03T02:03:51Z")

</div>

ah, ok … I thought it was a version thing, I faced lots of this stuff in my journey 😃  
Thanks, and Good luck to you , keep coding this is very fun and interesting, See ya )

[Previous page](https://forums.unrealengine.com/t/how-to-set-the-actor-rotation-to-yaw-in-c/547082.md?page=1)
