When I pause during the countdown the game does not freeze PLS SOMEONE HELP.

When I press the pause button during the countdown to start the game, the game goes to the pause menu but does not freeze the game.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//This is the countdown script
public class DelayedStartScript : MonoBehaviour
{

    public GameObject countDown;

    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine("StartDelay");
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    IEnumerator StartDelay ()
    {
        Time.timeScale = 0;
        float pauseTime = Time.realtimeSinceStartup + 4f;
        while (Time.realtimeSinceStartup < pauseTime)
            yield return 0;
        countDown.gameObject.SetActive(false);
        Time.timeScale = 1;
    }

}

Time.realtimeSinceStartup takes the time even when pausing. Instead, you can use Time.time

[Time.timescale] stop the fixedupdate but update and coroutines still running, you need create a variable and use it as a traffic light.