# How to add rotation

**URL:** <https://forums.unrealengine.com/t/how-to-add-rotation/615746>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [July 27, 2022, 7:03pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746 "2022-07-27T19:03:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaklakootmaa2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yaklakootmaa2/32/1194607_2.png) [@Yaklakootmaa2](https://forums.unrealengine.com/u/Yaklakootmaa2)\
**Post date:** [July 27, 2022, 7:03pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/1 "2022-07-27T19:03:56Z")

</div>

Hi everyone,  
Is there a way to add rotation in such a manner?  
It doesn’t work because of -180 +180 and you can get numbers over 180  
Previously to make this I had to use an additional component like an arrow to get rotation from it and use it for RInterp to as a target value. Now I’m working on refactoring my code and found this piece that I’m trying to optimize. Any help will be appreciated.

 ![UErot](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/4/264e0c1017db5fc9eb8f5121a9603e8e453fb6ea.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 27, 2022, 7:08pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/2 "2022-07-27T19:08:27Z")

</div>

This

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/3/f/83f4400fdf078f2d2f3836fb51ba549aeb0bfb63.png)

Just always make sure you add or subtract rotation. Don’t try and calculate the new rotation.

---

<div class="post-metadata">

**Author:** ![Yaklakootmaa2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yaklakootmaa2/32/1194607_2.png) [@Yaklakootmaa2](https://forums.unrealengine.com/u/Yaklakootmaa2)\
**Post date:** [July 27, 2022, 7:11pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/3 "2022-07-27T19:11:34Z")

</div>

Yeah, I know  
But my goal is to make smooth rotation

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/2/f02768f6305cb387c319b5e81c082cfcac1f9bbf.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 27, 2022, 7:14pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/4 "2022-07-27T19:14:33Z")

</div>

OK, try it with rinterp, it’s designed for it.

---

<div class="post-metadata">

**Author:** ![Yaklakootmaa2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yaklakootmaa2/32/1194607_2.png) [@Yaklakootmaa2](https://forums.unrealengine.com/u/Yaklakootmaa2)\
**Post date:** [July 27, 2022, 7:18pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/5 "2022-07-27T19:18:54Z")

</div>

I tried but the issue connected with the calculation of the target rotation, can’t figure out how to make this right. When I have target rotation like (0,0,190) this rotation never stops.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [July 27, 2022, 7:41pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/6 "2022-07-27T19:41:38Z")

</div>

I think it also might be that you’re just putting fixed rotations in.

It might work better if you

1. Sample the current rotation ( starting point )

2. Make the target rotation by using a ‘combine rotators’ node, putting the starting point as A, and the difference as B.

Then you can just a lerp.

I’m pretty sure this is right, but not at a machine rn…

---

<div class="post-metadata">

**Author:** ![Yaklakootmaa2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yaklakootmaa2/32/1194607_2.png) [@Yaklakootmaa2](https://forums.unrealengine.com/u/Yaklakootmaa2)\
**Post date:** [July 27, 2022, 7:47pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/7 "2022-07-27T19:47:22Z")

</div>

Thanks, will try it

---

<div class="post-metadata">

**Author:** ![Yaklakootmaa2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/yaklakootmaa2/32/1194607_2.png) [@Yaklakootmaa2](https://forums.unrealengine.com/u/Yaklakootmaa2)\
**Post date:** [July 27, 2022, 8:45pm UTC](https://forums.unrealengine.com/t/how-to-add-rotation/615746/8 "2022-07-27T20:45:22Z")

</div>

Probably, I found what you meant

> [@How to rotate an object in a specific direction?](https://forums.unrealengine.com/t/how-to-rotate-an-object-in-a-specific-direction/481521/2):
>
> You need to store the current and target rotations in variables. Don’t read from the object you’re rotating. Then you can just add any rotation you want: This assumes you start at 0,0,0, but then you can go anywhere. If you want to start from an unknown, then you need to use AddLocalRotation.
