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);
}
}
}