FireballMove.cs 498 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 15 16 17
	}

	// Update is called once per frame
	void Update () {
18 19 20 21 22 23
		//fireRB.MovePosition((Vector2)transform.position + move*speed);
	}

	void OnCollisionEnter2D(Collision2D c){

		Destroy (this.gameObject);
24 25
	}
}