I can't spot any errors in your code right now so I suppose that your obstacleGenerator Start() doesn't get called at all. Maybe there's no instance of your object, or you're accessing the wrong object in your obstacleGenerator() method. In this case a good way to debug is to insert Debug.Log() in each method and just check if something is missing.
On a side note, I recommend to **not** invoke specific methods after a "magic" delay to ensure that everything else has been called before. Instead, try to invoke your methods strictly in a row, so you can be 100% sure that everything gets called in your desired order.
↧