# How to rotate an object in a specific direction?

**URL:** <https://forums.unrealengine.com/t/how-to-rotate-an-object-in-a-specific-direction/481521>\
**Category:** Community & Industry Discussion\
**Tags:** rotator, direction, axis, unreal-engine, rotate, question\
**Created:** [April 7, 2021, 7:34am UTC](https://forums.unrealengine.com/t/how-to-rotate-an-object-in-a-specific-direction/481521 "2021-04-07T07:34:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon236](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandon236](https://forums.unrealengine.com/u/Brandon236)\
**Post date:** [April 7, 2021, 7:34am UTC](https://forums.unrealengine.com/t/how-to-rotate-an-object-in-a-specific-direction/481521/1 "2021-04-07T07:34:08Z")

</div>

Let’s say I have a cube at rotation `0,0,0` and then let’s say I rotate that cube forward in the X direction. Afterwards, the cube will be at rotation `90,0,0`. If I try to rotate a cube forward in the Y direction first, its rotation then becomes `0,90,0` so if I then try to rotate it forward in the X direction, the new rotation will be `90,0,90`.

The problem is that if I try to rotate this cube in a blueprint then I couldn’t use rotators to make sure it always rotates in the same direction regardless of its starting rotation. I’ve also tried using “rotation from axis and angle” and that didn’t work either. Does anyone know how I can rotate an object in the same direction regardless of its starting rotation?

---

<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:** [April 7, 2021, 10:39am UTC](https://forums.unrealengine.com/t/how-to-rotate-an-object-in-a-specific-direction/481521/2 "2021-04-07T10:39:59Z")

</div>

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:

 ![335014-screenshot-1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/7/b87cb6803efa3deb86b7471a2f3c6fc3e95c035d.jpeg)

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.
