how to change object pivot position, with scripting(java script)? (with image help)

hi all
i want when clike on the botton move object, pivot of right side to left side very slove .
for exmple a box when rotate thence cheange pivot.

i dont change pivot in 3d max .
i need source code (java).
please help me. :face_with_spiral_eyes:
Thanks: Free Image Upload, ผลบอลสด
thank for guide .

I’m not sure if you can change it during the gameplay, but you can parent your gameObject to empty gameObject, and that empty object would behave like your object pivot point. Why do you want to do that at all?, if you want to rotate your object on a specific way then maybe this will help: Unity - Scripting API: Transform.RotateAround