using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BulletScript : MonoBehaviour {

	private float interval = 10;
	private float counter = 0;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		this.gameObject.transform.position += transform.forward * 7.0f * Time.smoothDeltaTime;

		counter += Time.smoothDeltaTime;

		if (counter >= interval) {
			GameObject.Destroy (this.gameObject);
		}
	}

	void OnTriggerEnter(Collider other)
	{
        if (other.gameObject.name.ToLower().Equals("meat cleaver"))
        {
            this.gameObject.transform.rotation = GameObject.Find("Camera (eye)").transform.rotation;
        }
	}
}
