using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DestroyOnImpact : MonoBehaviour {

    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.rigidbody.gameObject.layer == LayerMask.NameToLayer("enemy")) return;
        Destroy(gameObject,0.1f);
    }
}
