if and invoke repeating in start...

This is my obstacle spawning code:

public GameObject Obstacles;
        float gameTime;
       
        
        void Start()
        {
            gameTime = Time.timeSinceLevelLoad;
            InvokeRepeating("CreateObstacle", 1f, 1.25f);
        }
        void Update()
        {  
        }
        
        void CreateObstacle()
        {  
            Instantiate(Obstacles);
        }

Now what I want to do is InvokeRepeat 1F, 1.25F only when gameTime > 0 && gameTime <= 46.
And InvokeRepeat 0.25f, 0.85f when gameTime > 46.

I have no idea how to do this, beceause if I´d try to make couple if statements they would never update beceause they have to be called in Start() right?

Thanks!

your assumption is correct, your if statement needs constant checking. What I’d do is check in update for a Boolean (above46seconds) and if true, return.
after that return statement check for the time and if it meets your condition. If it does, execute CancelInvoke, the ne InvokeRepeating and set the Boolean.
this way, when you go above 46 seconds, the invoke gets exchanged and update stops on the first if statement.
If you do all this with coroutines, there won’t be any execution at all when finished.