i have this explosion particle effect childed to a gameobject but when i destroy the gameobject
the particle effect is destroyed too, is there a way i can play the particle effect at the same time it’s destroyed?
this is how my code looks like at the moment
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerDeath : MonoBehaviour
{
[SerializeField] Collider[] deathCollider = new Collider[2];
[SerializeField] GameObject ball;
[SerializeField] ParticleSystem deathVFX;
private void Awake()
{
deathVFX.Stop();
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void OnTriggerEnter(Collider deathCollider)
{
Instantiate(deathVFX, transform.position, transform.rotation);
// deathVFX.Play();
Destroy(ball);
}
}