# Paper2D Rotation Issues

**URL:** <https://forums.unrealengine.com/t/paper2d-rotation-issues/308440>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [February 27, 2015, 9:00pm UTC](https://forums.unrealengine.com/t/paper2d-rotation-issues/308440 "2015-02-27T21:00:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![NearSingularity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NearSingularity](https://forums.unrealengine.com/u/NearSingularity)\
**Post date:** [February 27, 2015, 9:00pm UTC](https://forums.unrealengine.com/t/paper2d-rotation-issues/308440/1 "2015-02-27T21:00:36Z")

</div>

Hello all, now this being my second question I hope I provide enough information for someone to help me. I am still working on a top-down space shooter like Asteroids, Geometry Wars, etc. It is odd because my setup isn’t really top down, its an orthographic side-view looking down the Y axis in UE4, most typically the Z axis in any other coordinate system.

The collision seems fine now(first question), albeit I don’t know if I am applying Best Practices.

Rotation; however, is seemingly causing a lot of issues. I am rotating a sprite toward the mouse position here is the blueprint:

 ![31497-rotation.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/3/fc3a6c4a98ad334f4295d741ff856bce5caac62d.png)

As you see I am using atan2 to get the proper rotation degrees from the player to mouse, flipping it then adding an offset of -90 degrees to get the correct orientation. I found it odd that I had to rotate the Pitch to make it rotate the way I wanted (VERY ODD) I would expect the sprite to spin on the left-right axis causing it to spin forward/backward.

I assumed I would have had to rotate the Yaw, which should be pointing right at the camera and in the direction the cam is facing, to rotate left and right. However, when I rotate on the Yaw it acts like it is the Up vector which is the Z vector (which makes it roll)…and if I rotate the Roll it does nothing to the sprite!!!

Does the local axis of a paper2D sprite change to be a normal X(left-right) and Y(up-down) with Z pointing away/to the cam? Or does it remain just like the global axis of X(left-right) and Z(up-down) with Y (foward-back)

I still am trying to reconfigure my way of thinking with swapping the Y and Z axis while using UE4 and this rotation seems to be compounding confusing results.

I am then moving my player in the forward direction (which is apparently the X axis of the sprite) :

 ![31498-moveplayer.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/f/95f208db475cddb6330c4928b83ba0801926a09c.png)

What is happening is the axis are being flipped negatively. So by default the forward vector is pointing to the right. When I push my MoveUP axis it moves in the correct (right) direction. HOWEVER, when I move my mouse to the left-side and make the sprite rotate 180 degrees the sprite gets flipped but the forward still points RIGHT.

I debug the forward vector with velocity to determine if my sprite was really moving in its forward and it is indeed. You will notice it is going from 0 to -0.

Do sprites get rotated on the Y and Z by a negative offset (180) to handle rotation on the X axis above 90 and 180 degrees?? What is happening!?

It is tough to tell from the picture but my sprite moves right as it is facing left:

 ![31496-forward.velocity.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/0/ec02eb2fd40878468d94b8947a579242e3e92414.png)

---

<div class="post-metadata">

**Author:** ![NearSingularity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NearSingularity](https://forums.unrealengine.com/u/NearSingularity)\
**Post date:** [March 3, 2015, 1:57am UTC](https://forums.unrealengine.com/t/paper2d-rotation-issues/308440/2 "2015-03-03T01:57:13Z")

</div>

Do I have to bump this?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6d7d02f4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6d7d02f4](https://forums.unrealengine.com/u/anonymous_user_6d7d02f4)\
**Post date:** [March 6, 2015, 7:01am UTC](https://forums.unrealengine.com/t/paper2d-rotation-issues/308440/3 "2015-03-06T07:01:45Z")

</div>

Not sure, but looks like gimbal lock. I’ve got the same problem in my 2d game. Use quaternions instead of pitch/yaw/roll rotation.
