# Problem with AIM to SHOOT script

**URL:** https://discussions.unity.com/t/problem-with-aim-to-shoot-script/70092
**Category:** Questions & Answers
**Created:** [May 4, 2013, 6:00am UTC](https://discussions.unity.com/t/problem-with-aim-to-shoot-script/70092 "2013-05-04T06:00:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![paranoidplayer9](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@paranoidplayer9](https://discussions.unity.com/u/paranoidplayer9)
#### Post date: [May 4, 2013, 6:00am UTC](https://discussions.unity.com/t/problem-with-aim-to-shoot-script/70092/1 "2013-05-04T06:00:30Z")

</div>

I’m having a problem with a script, I’m really new to to coding but I don’t see anything wrong with it. The script makes you have to hold down FIRE2 to press FIRE1 to shoot. Whenever I hold down FIRE2 and press FIRE1 it just won’t shoot. It works when I take out the line with having to use FIRE2.

If anyone knows what I’m doing wrong with this code, I need help. Thanks in advanced!

```
var projectile : Transform;

function Start() {
}

function Update() {
	
	if(Input.GetButtonDown("Fire2")) {
		if (Input.GetButtonDown("Fire1")) {
			var Clone : Transform;
			clone = Instantiate(projectile, transform.position, transform.rotation);
			clone.rigidbody.AddForce(clone.transform.forward * 1000);
			rigidbody.AddRelativeForce(Vector3.forward * Time.deltaTime * 1000);
			Physics.IgnoreCollision(clone.collider, collider); 
		}
	}
}

```

---

<div class="post-metadata">

### Author: ![robertbu](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@robertbu](https://discussions.unity.com/u/robertbu)
#### Post date: [May 4, 2013, 6:40am UTC](https://discussions.unity.com/t/problem-with-aim-to-shoot-script/70092/2 "2013-05-04T06:40:45Z")

</div>

Input.GetButtonDown() only returns true for the frame in which it is pressed. Replace it with:

```
Input.GetButton("Fire2");

```
