Instantiate in same folder

Hi. I was wondering if there is a way to instantiate an object in the same folder on the hierarchy. I have a folder named Items that I use for raycasting all the items in that folder. So I want to be able to instantiate in that folder because of the raycasting. Thank you.

The Hierarchy doesn’t have folders. It has GameObjects, and each GameObject can have children and parents thanks to the Transform features.

You can call Instantiate() with a specific Transform which you want as the parent.

GameObject myInstance = Instantiate(myPrefab,
    myVector3whereIwantIt,
    myQuaternonHowIwantItTurned,
    myOtherObjectToBeItsParent.transform);
2 Likes

Thank you very much, that helped immensely.