# how to disable instantiating projectile for the moment when the player jumps and hits the space bar to fire?

hii . i have a 2d game . and have a player who can jump whith up arrow and fire with space bar . now i want to disable the space bar when i jump , so that if i hit the space when i jump it wouldnt work and dont shoot any projectile for a while . the reason that i want to do this is that now if i hit the up arrow and jump and while jumping hit the space bar to fire it fires projectile but jumps again while its in the air and goes a lil upper!!!
tnx

here is my player script . really apreciate if u can help me :

var playerSpeed : int;

var jumpHeight : int;

var fireBallPrefab : Rigidbody;

function Update ()
{

//1- player movement

``````amtToMove = playerSpeed * Input.GetAxisRaw("Horizontal") * Time.deltaTime;     // amount to move the player

transform.Translate(Vector3.right * amtToMove);
``````

//------------------------------------------------------------------------

//2- player rotation…!

`````` if (Input.GetKey("left") || Input.GetKey("a"))
{

transform.rotation = Quaternion.Euler(0,180,0);

}
if (Input.GetKey("right") || Input.GetKey("d"))
{

transform.rotation = Quaternion.Euler(0,0,0);

}
``````

//--------------------------------------------------------------------------

//3- player jump

``````// player can countinusly jump when you hold the up button. if its transform position in y axis is equal to 0.73(on the ground)
``````

if ( (Input.GetKey(“up”) || Input.GetKey(“w”) ) && transform.position.y == 0.73)

``````  {

amtToJump = jumpHeight + Time.smoothDeltaTime ;

transform.Translate(Vector3.up * amtToJump );

}

//4- instantiate fireBall

if (Input.GetKeyDown("space"))
{
var tempfireBall : Rigidbody;
tempfireBall = Instantiate(fireBallPrefab,Vector3(transform.position.x , transform.position.y, transform.position.z),transform.rotation);
}
``````

}

1.make a raycast under the player

var ableToJump:boolean;
If(!(Physics.Raycast(transform.position,Vector3.down,distance)))
{

//Everything in here executed when the character has jumped so high the raycast doesn’t //touch the ground

ableToJump=False;
}
if(ableToJump&&Input.getButton(“Jump”))

{ transform.position.z+=5; }