unity-game-engine

Unity 3D: Door rotation around pivot point not working as expected


I'm trying to create a door that rotates realistically (like opening and closing) in Unity 3D, but I'm encountering some issues:

  1. When I try to rotate the door, it rotates around its center instead of the edge where the hinges should be.
  2. I attempted to fix this by moving the pivot point to the edge of the door in the Transform component, but when I move the door to an empty GameObject, the pivot point resets and aligns with the door's center again.

enter image description here

What I've Tried

  1. Adjusting the pivot point in the Transform component
  2. Moving the door to an empty GameObject to control rotation

Solution

  • Although the image is a bit dim, I noticed the button on the top left of the scene window, you selected Center, you need to select Pivot.

    Also you can check the section "Gizmo handle position toggles" in the document: https://docs.unity3d.com/Manual/PositioningGameObjects.html