How can I make the player temporarily unable to move?

Hey guys. I have followed the Unity Space Shooter tutorial, adding my own touches and flairs once I had completed the project according to the tutorial. One of these changes was adding a larger space ship at the bottom of the screen that is destroyed if an asteroid hits it, causing a “game over” and prompting the player to press R to restart the game. My problem is that if the larger ship is destroyed, but the player’s ship is not, the player can continue flying around, shooting the rest of the asteroids in the current wave. This allows the player to get extra points after the game has supposedly ended. I want to make the player unable to move if game is over. However, the player still needs to be able to press R to restart. So is there a way to block certain player input (arrow keys and WASD keys), but still register other inputs (R key)? Or is there a better way to go about this?

Add an if statements do a Boolean variable before any of the input portions of your code. It would look like this:

var canControl : boolean = true;

function Update () {
    if (canControl) {
         // Your input code
    }
}

Then, when the bottom ship gets destroyed, just change canControl to false.

First off, thanks a million to both of you for the answers. Now, both of your answers make sense. I’m just trying to figure out how to implement them. The problem is that I have two different scripts, one that manages the ships, and contains instructions for their destruction called DestroyByContact.cs. The other is called PlayerController.cs and contains the input code. I think the best way to go would be to take fifthknotch’s solution, and make a bool variable. The DestroyByContact script would look something like this. Just for clarification, the bottom ship is tagged ProtectMe.

public bool canControl;
		if(other.tag == "ProtectMe")
		{ 
			Instantiate(sSExplosion, other.transform.position, other.transform.rotation);
            canControl = false;
	        gameController.GameOver ();
			scoreValue = 0;
	}

Then do something similar in the PlayerController script

public book canControl;

    void FixedUpdate ()
    {
        if(canControl) 
       {
           float moveHorizontal = Input.GetAxis ("Horizontal");
           float moveVertical = Input.GetAxis ("Vertical");
       }
    }

I have tried to add an if statement to the DestroyByContact script,

if(canControl = false 
{
PlayerController.canControl = false.
}

but I got this error

Assets/Scripts/DestroyByContact.cs(43,42): error CS0120: An object reference is required to access non-static member `PlayerController.canControl’

I don’t know if it’s just that I am trying to access the canControl variable in the PlayerController script incorrectly?