- Home /
How to spawn objects in areas that are only created at run time?
Hello everyone. Now I'm doing a prototype based on Unity tutorial live training 'Making A Flappy Bird Style Game'. But in my prototype, player can change difficulty before playing a game. Difficulty will change spawn rate of columns, gap distance between 2 columns, and speed at run time.
This is how the columns spawn https://unity3d.com/learn/tutorials/topics/2d-game-creation/recycling-obstacles-object-pooling?playlist=17093
Lowest difficulty
Highest difficulty
I also want to add coins for player to collect (using object pool like Column Pool in tutorial). I tried several ways like letting Coin Pool have its own spawn timer or adding offset to column spawn position but the results are not good.
The ideal situation would be to find the area between 2 sets of columns (red lined rhombus or square) and then randomly spawn in that area. The coins also shouldn't overlap with each other, the columns and the floor.
What is a good way to implement this? Thank you very much for every suggestion.
Your answer
