- Home /
changing pivot's placement
Hi guys!
I'm trying to change my prefab's pivot position but I can't do it, not even from objects already placed in the world. I've tried to play with the buttons in the interface's toolbar (http://docs.unity3d.com/Documentation/Manual/LearningtheInterface.html), but it always moves the object, not the pivot.
How can I achieve this?
Thanks!
Answer by ScroodgeM · Aug 20, 2012 at 09:35 PM
pivot is a zero-point for model. all model's vertices are stored in XYZ relative to this point. so, to move pivot you should update all vertices. so:
solution 1
move it in 3d software and reexportsolution 2
make a script that will update all mesh vertice's coordssolution 3
make an empty GameObject and make your transform as child for emptyGO. move child relative to emptyGO to position you need, use emptyGO as pivot.Too bad Unity can't handle that in a simple way. Anyway thanks, that solved my problem. :)
your task needs some actions with geometry source (solution 2), this is completely not unity's job 8)
this like painting a textures in unity. unity also can't handle that is simple way cause again this is not unity's job at all 8)
Answer by dEusEx_Machina · Jan 30, 2019 at 09:42 PM
Hi guys, i know its a little bit too late for this answer, but I'm here in 2019 :).
So, if you're using a prefab and the pivot is off, ( not where you want it to be ), you can create an empty actor inside the prefab, add every model of the prefab inside your new empty actor, this is the tricky part.
You need to reference the prefab pivot with the grid, move your new empty actor so all the assets inside the prefabs are exactly where you want them to be ( remembering where your old pivot point was ), then unparent the assets from the new empty actor and the pivot will be exactly where you want it to be.
Note: If you have this prefabs in the scene already, you will need to rearrange your scene because the assets will change place.