using UnityEngine;
using System.Collections;

public class Shoot : MonoBehaviour {

	private float rotation;
	public Transform cratePrefab;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		if(Input.GetButtonDown("Fire1"))
		{
			Object crate = Instantiate(cratePrefab, new Vector3(transform.position.x, transform.position.y+2, transform.position.z), Quaternion.identity);
			
			((Transform) crate).rigidbody.AddForce(transform.forward * 2000);
			
		}
		
	}
}
