Disable game controller while pause is active

Hello, I’m making a Flappy Bird game and I added the pause button the to the game. When I press the pause button the game is paused by Time.timeScale = 0; but if I press the jump button (in my case is the Space button) and then hit the resume button the bird jumps instantly when the game resumes. That means that the controller is still working while the pause is activated. How can I disable the controller?

This is the pause script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Pause : MonoBehaviour
{
Image img;

public Sprite playSprite;
public Sprite pauseSprite;

private void Start()
{
    img = GetComponent<Image>();
}
public void OnPausedGame()
{
    if(GameManager.gameIsPaused == false)
    {
        Time.timeScale = 0;
        img.sprite = playSprite;
        GameManager.gameIsPaused = true;
    }
    else
    {
        Time.timeScale = 1;
        img.sprite = pauseSprite;
        GameManager.gameIsPaused = false;
    }
}

}

This is my controller script:

private void Update()
{
if (isDead == false)
{
if (Input.GetKey(KeyCode.Space))
{
rb2d.AddRelativeForce(Vector3.up);
}
}
}

Try getting the player object and disabling the script of movement when game is paused, and enable it when not. If you don’t know how to disable a script use

GameObject.Find("objectname").GetComponent(<Component>).enabled =  false;

That is for disable, for enable just replace “false” with “true”. And you must replace “objectname” with the name of the player object and change (component) with the movement script’s name. So it will be something like this:

  if(GameManager.gameIsPaused == false)
 {
     Time.timeScale = 0;
     img.sprite = playSprite;
     GameManager.gameIsPaused = true;
     gameObject.Find("Player").GetComponent(<MovementScript>).enabled =  true;
 }
 else
 {
     Time.timeScale = 1;
     img.sprite = pauseSprite;
     GameManager.gameIsPaused = false;
     gameObject.Find("Player").GetComponent(<MovementScript>).enabled =  false;
 }

Don’t forget to replace what I said before. If you want you can replace
gameObject.Find("player") to gameObject.FindWithTag("player)
JUST IF YOU WANT @Brijac