using System;
using UnityEngine;

public class Collectible : MonoBehaviour
{
    public GameObject confetti;
    
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            spawnParticles();
            Destroy(gameObject);
        }
    }

    private void spawnParticles()
    {
        Instantiate(confetti, transform.position, Quaternion.identity);
    }
}
