Change an object's pivot point?

Discussion in 'Editor & General Support' started by mrittman, May 12, 2009.

  1. mrittman

    mrittman

    New Member

    Joined:
    May 11, 2009
    Messages:
    40
    Hey I can't find this anywhere...Can someone tell me how I might go about changing an objects center point? I imported an object from 3ds max into Unity but Unity reset its center point to the center of the object.

    Thanks!
     
  2. antenna tree

    antenna tree

    Moderator

    Joined:
    Oct 30, 2005
    Messages:
    5,300
  3. mrittman

    mrittman

    New Member

    Joined:
    May 11, 2009
    Messages:
    40
    I tried messing with both those buttons and they didn't do anything...
     
  4. mrittman

    mrittman

    New Member

    Joined:
    May 11, 2009
    Messages:
    40
    Figured it out. You have to convert the object to an editable poly inside of 3ds max before exporting it.
     
  5. splashy

    splashy

    Member

    Joined:
    Aug 5, 2008
    Messages:
    3
    I too would like the answer to this, I have created a simple object in my 3d app (Modo) and although the pivot points were set correctly in the app they appear to be quite a way off on the x axis in Unity.

    If I change the pivot point in Unity it does indeed set the pivot point correctly in the view but when I rotate my object using code it is rotating around the offset pivot and not the correct center point.

    Any help offered is greatly appreciated.
     
  6. swtoasty

    swtoasty

    New Member

    Joined:
    Dec 10, 2008
    Messages:
    25
    Using silo at the moment and I am having a similar problem. I've tried exporting as .3ds and .objs, and whenever I import them into Unity the pivot point on the objects are always way off center.

    Also, pretty sure that the objects pivot point in the 3d Application is centered...But when imported into Unity it becomes messed up.

    Is there anyway to fix this besides using the empty game object trick?
     
  7. Joe Robins

    Joe Robins

    Unity Technologies

    Joined:
    Apr 21, 2008
    Messages:
    429
    Just for future reference RE 3d Studio Max and pivot points, you can modify an object's pivot point inside max at any time using the hierarchy tab see attached image:
     

    Attached Files:

  8. Screenhog

    Screenhog

    Member

    Joined:
    Jul 2, 2009
    Messages:
    483
    Sometimes, the easiest solution is just to parent your mesh to an empty GameObject that was placed where you want your pivot point to be, and rotate that instead.
     
  9. NoirTalon

    NoirTalon

    New Member

    Joined:
    Sep 20, 2009
    Messages:
    1
    There are just going to be times we have a bogus pivot point in a model, and we want it to rotate in a sane manner. It may very well be a bug that unity does not rotate about an objects center, or the bug may be that the pivot point can not be changed once the model is imported. I won't debate that here, but I will provide a fix.

    1)Create a new blank object in your scene, give it a name like "WackoPivotPoint"
    2)Put that object just where you want the pivot point to be, for the errent model
    3) Now make this new blank object a Child of the errent model
    4) whenever you want to rotate the errent model in script, use the "find" function from the errent model's transform. find the child transform by name. In this case
    Code (csharp):
    1. pivot = errentModel.transform.Find("WackoPivotPoint");
    5) Next use the RotateAround function to, well, do just that. in this case
    Code (csharp):
    1. errentModel.transform.RotateAround(pivot.position, Vector3.up,20)
    the following code uses a child transform called "SelectorPivot" to rotate around by 20 degrees


    Code (csharp):
    1.     var pivot : Transform = transform.Find("SelectorPivot");
    2.     this.transform.RotateAround(pivot.position, Vector3.up, -20);

    I hope this helps!

    P.S. don't bug me about the spelling. It's 2:45 am, and I just don't care.
     
    Yoman likes this.