Instantiate prefab at level progress

Hey !

I need help with instantiate a prefab(dirt block) like 10 units in front of my character.
With my script below, they spawn too close to each other, there’s absolutely no space in between.
My game is in 2D and the dirt blocks are sprites.
Can anyone help me out ?

	void Update()
{

		Instantiate (dirt, new Vector3(player.transform.position.x + 10f, -5.237257f + 0.5572577f, 0), Quaternion.identity);
	}

One thing your using update to add these which means you’ll add a ton every single second which is probably not what you want, however to answer your question to create your prefab infront of the player you can do:

 Instantiate (dirt, (transform.position + transform.forward * distance), Quaternion.identity);

Note the distance variable there just set it to whatever you want ie 10.0f

Hope this helps

Cheers

Marc