Rotating Everything Around 180 Degrees

posted to: Rocketship Movement

So you mentioned in a comment in Planets, Supply Station and Text Messages that we need to rotate everything by 180 degrees such that +X is on the right side. This video is the first one I see with +X on the right side, so I gave this a try.

The Environment seems straightforward (rotate 180 on Y), as is readjusting the Main Camera and Directional Light positions. I also rotated the Skybox by 180 in the Sky material's settings.

The Rocket doesn't seem as straightforward. If I rotate it 180 on Y, then the script has to also be adjusted:

  rigid.rotation = Quaternion.Euler(0, 180, Input.GetAxis("Horizontal") * -tilt);

But now the ship's tilt is reversed, so I also have to remove the negative in tilt:

 rigid.rotation = Quaternion.Euler(0, 180, Input.GetAxis("Horizontal") * tilt);

How did you get the ship to face the right direction in the video, where the Transform component shows (0, 0, 0) for the rotation?


EDIT: OK, this comment thread helped. I did try rotating the child meshes before, but the part I missed was making the window a child of the fuselage, rotating the fuselage, and then unparenting afterwards. So no changes in the script are necessary now, and the Rocket can have a rotation of (0, 0, 0).

  • Jonathan Gonzalez(jgonzalez) replied

    Yeah I apologize I should've gone into more detail about this. The ship is the main culprit and it can be a bit confusing to get it working right. The visible portions of the ship need to be rotated as the main parent needs to have no rotation otherwise I'll automatically rotate it through script.

    It may be possible to take into account the original ship rotation and multiply that by the axis values used but rotating it manually was an easier and cleaner solution.