C# Rotate GameObject at Other Point other than Center

Is there a way to adjust where a gameobject is rotated? I would like to rotate a gameobject at a different point other than the center of the gameobject.

Three ways:

  1. Complex Math to translate, rotate & translate.
  2. Create a empty game object called ‘pivot’, attach your game object to pivot, then move & rotate pivot rather then the game object.
  3. Using your favorite 3d modelling tool, edit the pivot point/origin for the model you are working with.

At the top left, you should see a button called “Center”, left click it once and it should change to “Pivot”;
If it keeps rotating at the center still, you need to open up the model into a 3D modelling application and set the pivot point where you wish.

The pivot of a gameobject can’t be changed in Unity. this is commonly done in a 3D modelling application. However, you can use an existing, or create a new, gameobject in your scene (even an empty one) and make it a parent of the gameobject that should be rotated, using the parent object as a pivot point. Now you can rotate the parent and the child will roate around the parent, i.e. the rotation point.

Edit: There’s also Transform.RotateAround.