Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How to set the canonical orientation of a prefab?

Discussion in '2D' started by Shedletsky, Jun 15, 2014.

  1. Shedletsky

    Shedletsky

    Joined:
    Apr 21, 2014
    Posts:
    20
    I am using a 3D ship model that I stole from the Unity Shooter demo. In this 2D demo, the game is set up in the X-Z plane.

    I have exported this prefab and imported it into a new Unity project set up for 2D. By default, Unity uses the X-Y plane for 2D.

    When I attach a RigidBody2D to the ship and try to torque it, it rotates on the wrong axis (head over heels).

    How do I "pre-transform" my prefab so that Y+ is the front of the ship instead of the bottom?
     
  2. Shedletsky

    Shedletsky

    Joined:
    Apr 21, 2014
    Posts:
    20
    Note: I am not asking how to transform the ship. I know that by rotating by X = 270 I can get the ship to point forward. However, the RigidBody2D.AddTorque function assumes rotation around Z.

    So my ship does a barrel roll instead of pivoting.
     
  3. Shedletsky

    Shedletsky

    Joined:
    Apr 21, 2014
    Posts:
    20
    Anyone? Not being able to do a simple rotation in Unity makes me feel stupid.

    I've discovered the "Apply to prefab" menu item, but it is disabled for me, and so maybe not useful for baking in a rotation.