Problems with Spawner and timer.

So i have my main menu where is Start button… I want to activate timeToSpaComet timer (timeToSpawnComet) after i click the button. Cause when its not activated: When i click Start button it spawns imidietly cause Time.time >= timeToSpaComet && GameStarted == true ARE TRUE from the beggining if im w8ing in the menu some time.
Does anyone have some ideas?

  if(Time.time >= timeToSpaComet && GameStarted == true)
    			timeToSpaComet = Time.time + timeBetweenWavComet;

This should give you what you need.

    //spawn every x seconds, in this case 3 seconds
    private float spawnTimer = 3.0f;
    //increments every frame by the difference in time from this frame to the previous
    private float timeElaspedSinceLastComet = 0.0f;

    private bool GameStarted = true;

    private void Update()

        timeElaspedSinceLastComet += Time.deltaTime;
        if (timeElaspedSinceLastComet >= spawnTimer && GameStarted)

            timeElaspedSinceLastComet = 0;


    private void SpawnObject()
        Debug.Log("Object spawned");