Move pivot from prefab or spawn it from child
I don't know how to ask this question. I have a modular level generator that spawns prefabs. I have a prefabs that is 10 points long in X(figure A), so I spawn another from a gameobject position inside that prefab that is a spawn point 10 points after the origin from this prefab(point B). Having a controlled size works fine, but I want to add prefabs with different forms, they would have different sizes and their origin point would be somewhere else. My question is, can I a) Spawn the following prefab using a gameobject position inside such prefab. For example, where prefab A ends prefabs B begins. Something like
LLLLLL|LLLLL
|
LLLLLL|LLLLL
where the | would be the spawn point of the next prefab.
B)Move the prefab origin point so I can always spawn it from the same position without having to hard code the spawn point position for each prefab.
Thank you people!
Answer by Javyer · Sep 30, 2015 at 08:27 PM
I solved my problem. I put the editor in "show pivot" mode, moved everything inside a gameobject and aligned everything inside said gameobject. Now when I spawn a prefab it use the gameobject position as the origin point
Your answer
![](https://koobas.hobune.stream/wayback/20220612035016im_/https://answers.unity.com/themes/thub/images/avi.jpg)