- Home /
Instantiated Game Object is at the wrong location.
All of the objects are getting instantiated at the pivot point instead of the centre point. As you can see for some reason, my procedurally generated mesh's pivot point is located at 0,0,0 instead of its centre, which creates a few problems for my position calculations for other objects, including instantiating new ones.
So as for the question to fix this problem: is it possible to change pivot point to its mesh's centre point? (some googling shown me that it might be impossible) or is it possible to get the vector for the mesh's centre point, so that I could instantiate objects at that vector?
Answer by magzh · Nov 07, 2019 at 01:06 PM
Alright I found an answer to the centre point:
https://docs.unity3d.com/ScriptReference/Renderer-bounds.html
Renderer.bounds.center seems to give exactly what I needed.
I would still love to know if it is possible to change pivot point though or if it is planned for future unity versions.
Your answer
Follow this Question
Related Questions
Move from center and not pivot. 1 Answer
Change RectTransform pivot without changing position 0 Answers
How to change a prefab's pivot point to exactly its center? 0 Answers
center of object group 0 Answers
Please help finding center of object 1 Answer