# How to get true pitch of a rotator?

**URL:** <https://forums.unrealengine.com/t/how-to-get-true-pitch-of-a-rotator/402633>\
**Category:** Community & Industry Discussion\
**Tags:** math, rotator, unreal-engine, UE4, question\
**Created:** [August 23, 2017, 3:00pm UTC](https://forums.unrealengine.com/t/how-to-get-true-pitch-of-a-rotator/402633 "2017-08-23T15:00:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emixam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Emixam](https://forums.unrealengine.com/u/Emixam)\
**Post date:** [August 23, 2017, 3:00pm UTC](https://forums.unrealengine.com/t/how-to-get-true-pitch-of-a-rotator/402633/1 "2017-08-23T15:00:44Z")

</div>

Hello,

I just discovered that in rotators, when the pitch (y) goes over 90 or under -90, roll (x) & yaw (z) are subtract by 180 and y goes the over way (the exact formula is y\<0 ? (-90 + (-90 -y)) : (90 + (90 -x)))

It’s causing me troubles cause I want to clamp the rotations of some joints of my skeletal mesh (moved by Kinect), but the jump of 180 in x & z make it real buggy.

Thus I’m looking for a node, or a formula or anything to get the true value of a rotator (by true I mean values that goes 0-360 for each component)

I’ve been searching the most I could, but I didn’t find the answer, please help

---

<div class="post-metadata">

**Author:** ![Piterop](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Piterop](https://forums.unrealengine.com/u/Piterop)\
**Post date:** [November 14, 2018, 9:02am UTC](https://forums.unrealengine.com/t/how-to-get-true-pitch-of-a-rotator/402633/2 "2018-11-14T09:02:54Z")

</div>

Did you resolved the issue?

---

<div class="post-metadata">

**Author:** ![DavidOConnor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/davidoconnor/32/978533_2.png) [@DavidOConnor](https://forums.unrealengine.com/u/DavidOConnor)\
**Post date:** [November 15, 2018, 6:49am UTC](https://forums.unrealengine.com/t/how-to-get-true-pitch-of-a-rotator/402633/3 "2018-11-15T06:49:49Z")

</div>

I’m not sure if this will work… but in your calculations and clamping… try not to break out the rotators into float values… clamp the rotators and do the calculations (with them instead… I’m fairly sure I read somewhere that Unreal has some internal setup that sometimes avoids that weird flipping that occurs

---

<div class="post-metadata">

**Author:** ![emperor\_katax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/emperor_katax/32/1070178_2.png) [@emperor\_katax](https://forums.unrealengine.com/u/emperor_katax)\
**Post date:** [December 10, 2018, 8:33am UTC](https://forums.unrealengine.com/t/how-to-get-true-pitch-of-a-rotator/402633/4 "2018-12-10T08:33:29Z")

</div>

… try this:

![261839-sc-00-emperor-katax.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/c/eec84da86ce2f3faa2beaa36fd22dcd5109f3d42.png)

… and well, not exactly sure why, the Yay in output, is the actual Pitch of the original input …
