[Solved] How to Dynamicaly assemble an Object in your Resource Folder

Am trying to dynamically create a platform but I want the tiles to randomly assemble depending on length and type of tile/object I want to be part of the platform.

Example = stands for a piece of the platform + equals object




I have a Parent object in my resource folder which contains all I need to make my platform work
I need to dynamically make Sprites / Objects to be children of this parent before I instantiate the entire object.

Any Ideas I been looking and trying different things but no success yet.
I already tried just to see but just instantiates the parent without the child :frowning:

public class testing : MonoBehaviour {
public GameObject parent;
public GameObject child;

void Start () {

    Vector3 spawnPos = new Vector3(transform.position.x, transform.position.y, 0f);
    //child = (GameObject)Instantiate(child, spawnPos, Quaternion.identity);
   // parent = (GameObject)Instantiate(parent, spawnPos, Quaternion.identity);

    child.transform.parent = parent.transform

    Instantiate(parent, spawnPos, Quaternion.identity);


I got IT!!

I basically had a dummy parent and extended from my Platform class to GeneratedPlatform and had a public array that held references to tiles. Before Instantiate I set the public array to a dynamically created array with tile refs and correctly build my platform.