- Home /
change pivot of parent game object
I would like to change the pivot location of a GameObject. I have created a Prefab from several GameObjects and the pivot of the prefab is set to the origin of the scene. I would like to change the pivot point, how should I proceed?
What I would like is for the children objects to stay in the same place and be able to move the pivot of the parent object around.
Do you mean you want to move the pivot in local or world space? When you call translate or any position function, the object is moved at the pivot.
I have a stack of wine glasses as GameObjects. These are ordered under a WineGlassStack parent. When the location of this WineGlassStack is set to (0,0,0) I want the lowest glass be placed on top of it, so I can easily put it on a table. I found out that you can select all childs and move them to the correct position in the stack space. The only problem is that you can only move them with the mouse which is not accurate. When I set the location in the Inspector it places the first selected item only.
Answer by Mike 3 · Jun 02, 2010 at 01:08 PM
Move the parent (via the inspector) so that the children are in the right place the if the pivot was 0, 0, 0
Then, unparent the children, set the parent to 0,0,0, and reparent
Thank you! Very simple solution to an annoying problem. :)
Great solution! But finding the "right place" is kinda manual, so its not very accurate. Is there no other automated way?
@raarchaeon yes, check my comment on the question. There's a link.
Your answer
Follow this Question
Related Questions
Make a simple tree 1 Answer
how do I get reference to a parent or a child? 2 Answers
How to check parent value instead name value(more details in post) 3 Answers
How to set pivot point to the parent 1 Answer
Display Name Above Object 2 Answers