Is it possible to fill the area between 4 colliders with an instance of a game object?

i’m trying to create the ground for a 2d game and i’d like it to be made of individual pixels like gameobjects that are affected by the physics engine. my question is what would be the best way to initially fill up the area between the 4 colliders i want to create for the boundaries with those gameobjects. thank you.

It would be easier if you think about it the other way around. Creating your ground area first and then adding boundaries to it.

If you have a variable to set the width and height of the area you can use a nested for loop to create a grid of gameobjects.

	public int width = 10;
	public int height = 10;

	void Start(){

		for (int x = 0; x < width; x++) {
			for (int y = 0; y < height; y++) {
				// visit each coordinate and place a new game object there
				GameObject.CreatePrimitive(PrimitiveType.Cube).transform.position = new Vector3(x,y,0);
			}
		}

Now you can work out the coordinates of each corner and create a gameobject with a collider on it matching the length of the edge it follows.