FireballProjectile.cs 356 Bytes
Newer Older
Luke Smith's avatar
Luke Smith committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
using UnityEngine;
using System.Collections;

public class FireballProjectile : MonoBehaviour {

	[HideInInspector]
	public float speed;
	private Rigidbody2D rb;
	public Vector2 move;



	void Start () {
		rb = GetComponent<Rigidbody2D>();
		rb.velocity = (move * speed);
	}



	void OnCollisionEnter2D(Collision2D c){
		Destroy (this.gameObject);
	}
}