I want anything that enters that hitbox to be destroyed, however nothing actually happens, I am quite sure there is something wrong with my script, don’t know what though, i have pretty much done as unity tutorials have told me.
this is my script:
using UnityEngine;
using System.Collections;
public class Deleter : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void OnCollisionEnter2D (Collision2D col) {
DestroyImmediate(col.gameObject);
print (col.gameObject);
}
}
I am not getting any errors from the script. Anyone that can help, I would be thankfull.