I am trying to destroy a Gameobject on collision, but on collision it does not destroy and also the script is on the object i want to destroy.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeletePowerUp : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("PowerUpDestroyer"))
{
Debug.Log("Destroy this!!!");
Destroy(this.gameObject);
}
}
}

This is the inspector of object i want to destroy.
This is the inspector of object with the tag “PowerUpDestroyer”.
