Place object at instanciated object center

As you know, an instanciated object has its origin at (0,0,0) and the ‘pivot’ is set at the corner of this instantiated object. But I need to set this pivot in the center of my instanciated object only using C#. My plan was to have an EmptyObject placed at the center of my instanciated object and would parent it so I could rotate the whole thing from its center and not from the corner. But how do I get the coordinates to the center of my instanciated object? Thanks

Are you importing something from a unity store package? All of Unity’s default shapes will have their origin set to the center of the object. Generally speaking origin points are relative to the mesh, not (0,0,0). Unity’s coordinate system moves objects from their origin point. So if you had two of the same object with two different origin points and put them both at (0,0,0) they would actually be in different spots.
If you do not have access to the 3D file, then just eyeball it and put the empty object near the middle.

Unity does not have a function to calculate the center of a shape. For that you would need to use a 3D modelling program. For example, Blender has (“Set center to geometry”) which will put it at the mathematical center of an obscure shape.

I AS I said on previous comment I don’t import from store package. I guess I’ll have to do that; set the center inside previous used program. Thanks