using UnityEngine;
using System.Collections;

public class FireLaser : MonoBehaviour {
	public GameObject laserPrefab;
	Transform laserSpawn;

	void Start(){

		laserSpawn = transform.Find ("laserSpawn");
	}

	void Update () {
		CheckInput ();
	}

	void CheckInput(){
		if (Input.GetKeyDown (KeyCode.Space)) {
			Fire ();
		}
	}

	void Fire(){
		//Instantiate (laserPrefab);
		GameObject Laser = Instantiate (laserPrefab, laserSpawn.position, laserSpawn.rotation) as GameObject;
	}

}
