Sprite Prefab Offset

Hi, I have the following script to instantiate sprites and as you can see below I need the sprites to be lowered by -0.25 each time.

Here is the code I am using;

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MapGen : MonoBehaviour
{
    public GameObject prefab;

    public float gridX = 5f;
    public float gridY = 5f;

    public float offset;
    public float spacing = 2f;

    void Start()
    {
        for (int y = 0; y < gridY; y++)
        {
            for (int x = 0; x < gridX; x++)
            {
                Vector3 pos = new Vector3(x, y, 0) * spacing;
                Instantiate(prefab, pos, Quaternion.identity);
             
            }
        }
    }
}

Something like this?

for (int y = 0; y < gridY; y++)
        {
            float yOffset = y * -0.25f;
            for (int x = 0; x < gridX; x++)
            {
                float xOffset = x * -0.25f;
                Vector3 pos = new Vector3(xOffset, yOffset, 0) * spacing;
                Instantiate(prefab, pos, Quaternion.identity);
              
            }
        }

Thanks for the reply! I just gave that a whirl and it seems to be mushing them into each other - forgive me if I am missing something. Please see image of what I am trying to achieve: https://imgur.com/a/v9i9stU

well then I guess you only want the yOffset to be y * -0.25f;
and the xOffset is just x.

Hmm, this is the result: https://imgur.com/a/M7P9XH

I think I would need to get the second column and move it down -0.25 and then the next column down -0.50 then -0.75 etc. Any thoughts?

Well that is what my code will do.
For the first column it moves it 0 x - 0.25f, the next 1 x -0.25f, then 2 x -0.25f,…
Maybe you just need to add “1” ?
float yOffset = (1 + y) * -0.25f;

Adding that to the yOffset just seems to produce the same result - they are all squished into each other and they are all on the same x plane.

all the sprites seems to get effected no matter what I do, I need to somehow effect each column of sprites and move them down each time.

The problems is probably somewhere else in your code.