# Calculate total rotation?

**URL:** <https://forums.unrealengine.com/t/calculate-total-rotation/2317268>\
**Category:** Blueprint\
**Tags:** UE-5, unreal-engine, UE5, Blueprint, question, UE503\
**Created:** [February 4, 2025, 12:03pm UTC](https://forums.unrealengine.com/t/calculate-total-rotation/2317268 "2025-02-04T12:03:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skyboy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skyboy](https://forums.unrealengine.com/u/Skyboy)\
**Post date:** [February 4, 2025, 12:03pm UTC](https://forums.unrealengine.com/t/calculate-total-rotation/2317268/1 "2025-02-04T12:03:07Z")

</div>

Hey, Im struggling to remember how to do this.

I just need to calculate total rotation then reset at 360 on the pitch axis (Y)

Thanks For reading. Ill post updates the further If I get somewhere.

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [February 4, 2025, 12:04pm UTC](https://forums.unrealengine.com/t/calculate-total-rotation/2317268/2 "2025-02-04T12:04:06Z")

</div>

You can try this:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/a/7/fa77903b7bfcecbf8c7dbee537ce436005329d6c.jpeg "WTF Is? Modulus/Modulo/% in Unreal Engine 4 ( UE4 )") ](https://www.youtube.com/watch?v=HXCkOzkgamU)

---

<div class="post-metadata">

**Author:** ![Skyboy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skyboy](https://forums.unrealengine.com/u/Skyboy)\
**Post date:** [February 4, 2025, 12:08pm UTC](https://forums.unrealengine.com/t/calculate-total-rotation/2317268/3 "2025-02-04T12:08:06Z")

</div>

If Im calculating total rotation.

Im basically taking my starting rotation and my current rotation and measuring the difference?

This is where I am atm but this feels totally wrong, Im going to start this again now. Im resetting the starting point which is wrong I think.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/6/9860ef0ab09e07f0703be1f49b0c67ee1b12b83d.png)

Would modulous be used to fend off the +90 or +180 wrap araound? This is kinda where Im stuck is calculating total rather than having it bounce back and forwards due to the eular angles.

---

<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:** [February 4, 2025, 12:11pm UTC](https://forums.unrealengine.com/t/calculate-total-rotation/2317268/4 "2025-02-04T12:11:41Z")

</div>

> [@Eular Measurements and Rotations.](https://forums.unrealengine.com/t/eular-measurements-and-rotations/2188832/11):
>
> Or even simpler:

---

<div class="post-metadata">

**Author:** ![Skyboy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Skyboy](https://forums.unrealengine.com/u/Skyboy)\
**Post date:** [February 4, 2025, 12:16pm UTC](https://forums.unrealengine.com/t/calculate-total-rotation/2317268/5 "2025-02-04T12:16:02Z")

</div>

Ah yeah this is the thread I was trying to find. Nice thanks. Ive been in total brain fog atm. Starting to think I should get checked 😂

Does this change if Im doing calculations from a physics simulation?

My plan atm is to spin my ball using angular velocity in degrees. Measure how many degrees Ive rotated and then use that to automatically update local rotation to create rotation on another axis without it stumbling into gimbal lock.

It works manually and looks sick lol.

Atm Im using get physics angular velocity in degrees and then multiplying that by delta time and then adding it.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/5/9659598f5d1367685575cce27b2f6ada6967d8ab.png)

Then basically Im just going to ABS it and then flip it when it hits 0 or 360.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/f/94fc9ddb079575dfc54fb111625b0b67763d9e8d.png)

This doesnt feel the cleanest way to do this. But it means whenever Im at starting point. Its 0 and then either direction leads me too 360 at what point it zeros out for the new spin.

If anyone has any further infomation Itd love to really understand this, but I think talking it through got me there. Thanks guys.

---

<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:** [March 6, 2025, 12:16pm UTC](https://forums.unrealengine.com/t/calculate-total-rotation/2317268/6 "2025-03-06T12:16:22Z")

</div>

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