- Home /
Fixing pivot points with second gameObject workaround
I'm working on a simple tower defense game, here is the problem that I sent to the artist:
Without fixing this, I can't create a working tower because the turret won't rotate properly. Unfortunately, we are finding that Unity resets the pivots to the center of the object on import, even if the pivots are set up correctly in Maya.
My first workaround attempt was to follow this video: https://www.youtube.com/watch?v=6MjDv6pClN0
But in the editor things are not working out nicely. I'm trying to parent the turret object (not including the base) to an empty game object to use as a new pivot, but when I do this the new game object assumes the pivot of the child?!?! Even though the transform says 0, 0, 0 its not at 0, 0 , 0 but at the same place as the pivot from the child turret object (I tested with a new empty game object at actual 0). When I do the parenting, I can actually watch the empty game object pivot change.. this seems so backwards I can't believe it. This doesn't make any sense!! Do I have a cursed .obj?? Please help!
Answer by TheCodeTroll · Mar 27, 2013 at 02:07 AM
Are you using center mode, not pivot mode?
next to the movement/translate/rotate buttons at the top, there are toggles for:
Pivot / center mode, and world/local position mode. If you have parented the game object and its still taking the mesh pivot, I can only assume that it is in center mode, not 'pivot' center takes the centroid of all of the collider/mesh verts As far as I know. So try hitting "Z" or toggling the button up top and see if that helps! :)