Search code examples
c#unity-game-enginecoordinatesgameobject

Setting the pivot point at the center of the base of a GameObject


I am creating a game in Unity 3D. In the game scene I am dynamically creating GameObjects, one of which is a building. I would like to change the pivot of the building to be at the center of the base of the building, this way when I instantiate this GameObject, I can set it's position to (0, 0, 0) and it will make it easier to instantiate object within the building.

Is there a way to move my pivot point to the center of the base of the GameObject so that I can do this?


Solution

  • Wrap it in a parent object (and make that parent object the prefab). That's the only way.