Recursive and procedurally generated level

Hello all,
I’m working on a procedually generated level using 3D tiles and I’m having a issue with one of the steps, was wondering if anyone would know a better way to do this. So far I am able to get all my tiles generating in there proper place connected to exits and so forth my only problem is the collision checks to make sure there are no overlapping tiles. The code I’m using for this is:

    if(IsOverlapping(newTile))
    {
        Destroy(newTile.gameObject);
        return GetNewTile(exits, newExits, singles);
    }

IsOverlapping takes in the tile checks its bounds with all other created tiles that have passed the check and returns true if overlapping and false if not. If overlapping destroys the gameobject and calls the function again to create a new tag based on all exits that can have a new tile set to it. This works in Unity for 12 tiles deep builds but anything higher then this causes Unity to lock up. Any help in this would be greatly appreciated

Unity “locking up” is most often caused by an infinite loop in your code. There’s not enough information in your question to help further, but I suggest you print logs of the game state before each time this function is called, and try to understand the point at which no tile will satisfy the IsOverlapping test.