Is there any way to detach my particle system (to prevent him from disappear when the object is destroy)?
private void OnCollisionEnter2D(Collision2D collision)
{
//particle detach?
Destroy(gameObject);
}
Is there any way to detach my particle system (to prevent him from disappear when the object is destroy)?
private void OnCollisionEnter2D(Collision2D collision)
{
//particle detach?
Destroy(gameObject);
}
I tried GetComponent().transform.parent = null; but seems to not work.
you can add your particle system to an empty child.
and just before destroying your object, you can detach that child from its parent like this :
childObjet..transform.parent = null;