using UnityEngine;
using System.Collections;

public class Fire : MonoBehaviour {
	public GameObject BulletPrefab;
	public GameObject spawnBullet;
	
	float forceBullet = 1500.0f;
	
	// Update is called once per frame
	void Update () {
		if(Input.GetMouseButtonDown(0)){
			//Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
			GameObject bullet;
			bullet = (GameObject)Instantiate(BulletPrefab, transform.position, transform.rotation);
			bullet.rigidbody.AddForce(transform.forward*forceBullet);
		}
	}
}
