WaterShieldProjectile.cs 387 Bytes
Newer Older
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 WaterShieldProjectile : MonoBehaviour {

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


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



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