FireballMove.cs 370 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
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> ();
12 13
		fireRB.velocity = (move * speed);

14
	}
Jordan B Mckenney's avatar
Jordan B Mckenney committed
15
		
16 17
	void OnCollisionEnter2D(Collision2D c){

Jordan B Mckenney's avatar
Jordan B Mckenney committed
18
		Destroy (gameObject);
19 20
	}
}