Search Unity

How to make a default rotation of an object?

Discussion in 'Scripting' started by isoblt, Nov 28, 2012.

  1. isoblt

    isoblt

    Joined:
    Nov 3, 2012
    Posts:
    5
    Hi, I imported an *.obj doors from Sketchup, and I then realized that the doors were by accident not following the axis but instead were rotated for few degrees on Y axis. When I corrected it to position I wanted, I had rotation for that object (0,3.7,0)

    What I want to achieve is to make this position and rotation of my object default one, I want it to make its rotation equal to (0,0,0) while keeping the current position of obj in the world. How can this be done?
    Thanks
     
    Omelette_au_Goulage likes this.
  2. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    Make an empty game object, then add the door to it. Rotate the door (not the empty!) to the right spot. Make a prefab of the empty and use it for your doors.
     
  3. isoblt

    isoblt

    Joined:
    Nov 3, 2012
    Posts:
    5
    I tweaked it in sketchup again. And I already tried what you said but it didn't do because I used PivotManager.js script from unity wiki scripts that turned out to not work well and there was some bugs after using Center Pivot. But thanks anyway