Getting variable from script while keeping other code from it

Hello everyone,
in my GameManager.cs I was trying to do a coroutine which stops the scene, counts for 3 seconds, and starts everything in the scene.

I managed to stop game timer and stuff, but I’ve got a problem with Player not being stopped by the coroutine.

Player is managed by Player.cs. It has speed variable and some code, for example losing speed while gaining altitude.

I would like to keep that code, but stop Player from moving for 3 seconds while coroutine works, and then let him start.

This is what I tried to do in my GameManager. I get the component from other script and the speed variable. Bool ‘count’ checks if the coroutine is working. While it is, Player’s speed is meant to be 0, while it is not, speed is meant to be 90, and timer is supposed to start.

void Update()
    {
        GameObject plane = GameObject.Find("Player");
        Player s = plane.GetComponent<Player>();
         
        //Countdown working
        if (count == true)
        {
            s.speed = 0f;
            TimeText.text = ("0.0");
        }
      
        //Countdown finished
        if (count == false)
        {
            s.speed = 90.0f;
            //Game timer
            time += Time.deltaTime;
            TimeText.text = (time.ToString("f1"));
        }

Timer starts flawlessly, but I can rotate the Player while coroutine is playing (which I would like to avoid), and when the Player starts moving it doesn’t preserve the code from Player.cs (losing speed while gaining altitude stuff).

All I want is stop any Player movements for 3 seconds, and then let him go with all the code in Player.cs.

How can I tackle this?

I’d have a bool in the Player script, that if set to true you just ignore all movement inputs and not calculate any position changes. The bool should be set and cleared by functions that get called by the GameManager as needed. If you use physics, can also set isKinematic to true on pause, and false on unpause.

public class Player : MonoBehaviour
{
	bool isPaused = false;

	void Update()
	{
		//Anything that needs to be done even if paused goes here

		if(isPaused)
			return;
		
		//Do normal game stuff (inputs, movement, etc)
	}

	public void PauseMovement()
	{
		isPaused = true;

		//Anything else you need to stop movement
	}

	public void UnpauseMovement()
	{
		isPaused = false;

		//Anything else needed after unfreezing
	}
}

public class GameManager : MonoBehaviour
{
	Player playerScript;

	void Start()
	{
		//Finds and GetComponents should be done once and stored as they're both slow operations
		playerScript = GameObject.Find("Player").GetComponent<Player>();
	}

	IEnumerator FreezeGame3Seconds()
	{
		playerScript.PauseMovement();

		//Do freeze game stuff

		yield return new WaitForSeconds(3f);

		//Do unfreeze stuff

		playerScript.UnpauseMovement();
	}
}