Randomly Place Buttons With Allignment?

So i’m making a 2D game based onClick button functions. I would like to randomly spawn the buttons in different places. Yet, i would also like to spawn them with spacing and such. If you look at the file attached youll see what i’m getting at. This is my code as follows for the random spawn points. But it just spawns them where i set the values to, I.E Random.Range(300,0); or (0,300). But how can i set a boundary if you will.While Still Allowing them to be spaced as show in picture. I don’t want the player to see the same button setup each time they replay the game, or it’ll defeat the purpose of the game.

using UnityEngine;
using System.Collections;

public class RandomButton_1 : MonoBehaviour {

    float x;
    float y;
    float z;
    Vector3 pos;
   
    void Start()
    {
        x = Random.Range(300, 0);
        y = (225);
        z = (0);
        pos = new Vector3(x, y, z);
        transform.position = pos;
    }
}

2179569--144446--GameHelp.PNG

easiest way would probably be to make a grid of “slots”, i.e. empty gameobjects in the arrangement you want, then randomly assign the buttons to be children of a slot. It gives you complete control of the arrangement of the slots and keeps things random at runtime

Yeah I thought of that also. but then theres the problem of telling it that if theres a box already there, to not assign a new box to an existing box slot.

Yeah I still Cant figure it out. This is my code now.

using UnityEngine;
using System.Collections;

public class RandomButton_1 : MonoBehaviour {

    public GameObject cube;
    public GameObject cube1;

    //float x;
    //float y;
    //float z;
    //Vector3 pos;
   
    void Start()
    {

           
        Vector3 position = new Vector3(Random.Range(112, 91), 1, Random.Range(0,91));
        Instantiate (cube, position, Quaternion.identity);
        Vector3 position1 = new Vector3(Random.Range(0,91), 1, Random.Range(112,91));
        Instantiate (cube1, position, Quaternion.identity);

        //x = Random.Range(300, 0);
        //y = (225);
        //z = (0);
        //pos = new Vector3(x, y, z);
        //transform.position = pos;
    }
}

Its not spawning anything now