FireballMove.cs 370 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
using UnityEngine;
using System.Collections;

public class FireballMove : MonoBehaviour {
	public float speed;
	private Rigidbody2D fireRB;
	public Vector2 move;

	// Use this for initialization
	void Start () {
		fireRB = GetComponent<Rigidbody2D> ();
		fireRB.velocity = (move * speed);

	}
		
	void OnCollisionEnter2D(Collision2D c){

		Destroy (gameObject);
	}
}