Search Unity

Trying to pivot a door open.

Discussion in 'Editor & General Support' started by GlassWizzard, May 28, 2016.

  1. GlassWizzard

    GlassWizzard

    Joined:
    May 19, 2016
    Posts:
    3
    Hi, I am following a tutorial on the Unity basics. I am currently on a chapter about animation and am being shown how to create an empty object and use that as a hinge (after being placed where the hinge should be, designating the point of rotation),for a door opening animation, the actual door itself is then parented (dragged onto hinge/empty object in the hierarchy).

    This I have done but in the video when the empty hinge object is rotated the door object rotates on the hinge. For me however the door just rotates from its center like it always did even before being parented.

    So my issue is the parenting relationship does not effect my rotation point and I don't know what to do about that. Maybe it's a difference in versions?

    Any help appreciated.
    Thanks
     
  2. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,825
    Make sure the gameobject you are rotating has a pivot point which is located where the hinge is on the door.
    You have to figure out the actual world location of the hinge in the door. Then create the parent item at the same location as the hinge. Then drag the door into the parent item. (It sounds like you allready did this part). Then it should rotate the door around the hinge when you rotate the parent item. It sounds like your rotating the door instead of its parent item, or the pivot point of the parent item is not at the hinge location.