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);
}
}
}