I am creating Ball Panic Game and when I am shoot the arrow it show error and I can’t figure it out this…please help
""public void ShootTheArrow() {
if (Input.GetMouseButtonDown (0)) {
if (shootOnce) {
shootOnce = false;
StartCoroutine (PlayerTheShootAnimation ());
Instantiate(arrows[0], new Vector3 (transform.position.x, height, 0), Quaternion.identity);
} else if (shootTwice) {
shootTwice = false;
StartCoroutine (PlayerTheShootAnimation ());
Instantiate (arrows [1], new Vector3 (transform.position.x, height, 0), Quaternion.identity);
}
}
}"",System.IndexOutOfRangeException: Array index is out of range.
at PlayerScript.ShootTheArrow ()
I am working on a Ball Panic game and I can’t figure it out this error…trying to shoot the arrow.
please help !!