Help needed

Hey I’m making my fist real game, it’s a mobile game about a bird falling and dodging stuff.

I’m following a tutorial about making a infinite level from

. Only the problem is I have to make it to go down and not with platforms but with levelparts. I alsmost got it to work but weirdly, the levelparts are getting spawned diagonally as you can see in the video.

This is the script I use:

public GameObject Part1;
public GameObject Part2;
public GameObject Part3;
public GameObject Part4;
public GameObject Part5;
public GameObject Part6;
public GameObject Part7;
public GameObject Part8;
public GameObject Part9;
public GameObject Part10;
public Transform generationPoint;
public float heightBetween;

void Start()
{

}

void Update()
{
if(transform.position.y > generationPoint.position.y)
{
transform.position = new Vector3(transform.position.y + heightBetween, transform.position.x, transform.position.z);

Instantiate(Part1, transform.position, transform.rotation);
}
}
}

Use code tags when posting code (see the sticky post).

Looks like you’ve got your X and Y positions swapped in your Update, that’s probably an issue.

@StarManta If I do that they all just spawn in lines to the left

[SerializeField] private Player player;

and the visualstudio doesnt even understand Player anymore? idk why