Infinte Runner spawn logic

Hello, I am currently creating an infinite runner game. I have the basis for my spawn manager. But I have been prowling the web and can’t seem to find what I need to polish it off. How could I accomplish some kind of logic that tells my code “Hey, the objective has spawned in this location, do not spawn an obstacle within X amount of time/place”.

The closest thing I can imagine is creating a method which spawns obstacles and objectives, and then throwing in if statements. But I’m not too sure how it would work, and the ways I have tried is not successful.

Sounds like you need some kind of cooldown timer. When you create the objective, set the timer to a value. When that value hits 0, it’s safe to spawn things again.