I have the same code as the lecture however it keeps sending an error an object is destroyed?
private void Die()
{
Destroy(gameObject);
Instantiate(explosionDeath, transform.position, Quaternion.identity);
Destroy(explosionDeath, explosionLingerTime);
}
}
Edit: Strangely i fixed it by removing the codeline Destroy(explosionDeath, explosionLingerTime);
It still functions as expected and have the explosion VFX, however it does not clear the game of explosion gameobjects.