I cant delete the clones of a prefab i have. i have tried lots of things. i have a 2d box collider which i have applied this script to(istrigger is set to true).
and another script which spawns clones of aprefab. I have tried a lot of stuff and i cant get it to destroy the prefab clones or anything at all. any help appreciated
`
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BoxCookieDeleterC : MonoBehaviour
{
public void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag.Equals("cookies"))
{
Destroy(other.gameObject);
}
}
}
`,I have a 2d box collider which i applied this code to:
`
↧