Hello, I’m making a spaceship game that always goes up, and I want to create prefabs of “Mini Levels” like a section with axes, section with shooters, and more, but each section is different size, like the shooter is 50y height while the axes are 20y height, so I cannot instantiate in a constant speed, is there a way to instantiate when needed?
if(y>=20){Obstacle=Axes};
if(y>=50){Obstacles=Shooter};
Ofcourse you still have to define “y”, “Obstacle” and the prefered instantiated objects.
tip: for “y” you can try to check the current position of the spaceship. and when this current position is equal or higher than as example 20. then the Obstacle will be Axes.
It is also worth looking at the invoke function. InvokeRepeating, CancelInvoke, Invoke.
if you combine this with the above you can instantiate when ever you want.