Intantiated object's position

Reading the docs for Instantiate(), I don’t think it’s clear what exactly will be the world position of the instantiated object.

It looks like the given position argument is taken as the “center” of the object.

So, if I have a ground plane, I should instantiate the object at y = (object_height) / 2, so that the object’s bottom side is touching the ground?

When getting the object_height via a collider, I see that the prefab’s collider height is 0, and only after the instantiation it gets to be whatever is set in the editor. So I can’t use this method to calculate the object’s position y before it’s instantiated, right?

Also, how are instantiated prefab’s relative coordinates translated into the world space? I.e if the mesh in the prefab is put at Y = 5, and I call Instantiate() with position.y=0, will the world-coordinates of the mesh end up at y=5 or y=0?

If you have a pre fab with coordinates set at (0,0,0) and you instantiate that object it will be at those coordinates. Say you want to instantiate it at the ground plane position which is also (0,0,0) for example. Depending where your objects origin is, let’s use center mass for the example. Then your object will be halfway above and below the plane. So if you want it to be above ground, you will need to make an offset vector using the y coordinates.

so

Vector3 offset = new Vector3(0,5,0);

So something like

Instantiate(GameObject, (plane.transform.position + offset));

Something like that… my Code might be off. I’m not looking at references to double check but something to that manner.

It may be * instead of + though. Can’t remember