I have attached this script onto my gun object bu the bullet only fires in one direction,I have attached this code my gun but the bullet only fires in one direction

using System;
using UnityEngine;
public class ShootMissle : MonoBehaviour {

public GameObject spawnPoint;
public GameObject ExplosionPrefab;
public Rigidbody projectilePrefab;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

	if(Input.GetButtonDown("Fire1"))
	{
		Rigidbody hitPlayer;
		hitPlayer = Instantiate(projectilePrefab, transform.position, transform.rotation) as Rigidbody;
		hitPlayer.velocity = transform.TransformDirection(Vector3.forward * 100);
		//            Physics.IgnoreCollision ( projectilePrefab.collider, transform.root.collider );

	}

	for(var i =0; i < Input.touchCount; ++i)
	{
		if(Input.GetTouch(i).phase == TouchPhase.Began )
		{
			Rigidbody clone;
			clone = Instantiate(projectilePrefab, transform.position, transform.rotation) as Rigidbody;
			clone.velocity = transform.TransformDirection(Vector3.forward * 200);
			//            Physics.IgnoreCollision ( projectilePrefab.collider, transform.root.collider );

		}
	}

}

}

,

In line 30 of your script try the easy way

clone = Instantiate(projectilePrefab);

What does this do?

it just instantiates the object with the rotation and position of the current object