I checked the other answers for this but mine didn't get fixed Here's the code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyCollectibles : MonoBehaviour
{
private void Start()
{
Debug.Log("Hallo");
}
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log("Trigger");
}
private void OnCollisionEnter2D(Collision2D collision)
{
Debug.Log("Collsion");
// if (collision.gameObject.CompareTag("Collectible"))
// {
// Debug.Log("Apple");
// Destroy(collision.gameObject);
// }
}
}
And screenshots: