Instantiate prefab at specific path

With the following code, I initiate a prefab inside the Content parent. However, the prefab is always loaded at the bottom of Content. Is it possibe to initiate the prefab directly under the first “singleOpretContainer”?

You will see the instantiated object (SingleOpretContainer(clone)) is at the bottom, which is incorrect.

  // instantiate prefab
    vContent = GameObject.FindGameObjectWithTag("scrollSingle");
    Instantiate(prefab, vContent.transform,false);

alt text

You can use the SetSiblingIndex method of the transform.

What you should do is save your prefab on a variable and then call the SetSiblingIndex method to change its position in the hierarchy. Like this:

//Assuming that you are instantiating the prefab as a game object

GameObject clone = Instantiate(prefab,vContent.transform,false);
clone.transform.SetSiblingIndex(1);