I am new to Unity. I have developed scrolling backgrounds, floor, animation jump, slide and other things. The only thing left for now is an algorithm to spawn random objects, obstacles (I have created 3) that player has to dodge. My game has no platforms, it’s all flat, so I don’t need a random platform generator or similar.
Is there any idea, video tutorial or anything ? I am also new to programming C#, so it would be nice if you could explain with more details ? I am so eager to learn this!
I also checked for other similar questions, but couldn’t find anything specific to my question. Also I seen some other tutorials, but they are mostly for 3D or random platform generators.
How about making a cube gameobject and name it obstacles.
Then flatten it on the y axes and expand it on the x axes, but make the cube invisible.
Then add this script
If you know how to generate random platforms then you know how to spawn random objects/obstacles. Create obstacles in the same way as platforms with different positions and different scripts attached to them according to their behaviour.
Basic approach is to make prefab of obstacle gameobject and instantiate them on run time in similar way as you will instantiate platforms.