How to have child object remain after parent is destroyed?

hi,

I have an enemy that fires an object onto a wall that appears to morph into another shape when it lands. Currently, I have this wall shape as a prefab child of the enemy with its end position set and its renderer turned off. So when the initial projectile ball is fired (instantiated as normal) at the wall and appears to collide, the renderer of the wall object is turned on. I have done it this way to avoid further instantiation of objects.

Now, my question is that as this wall object is a child of the enemy, it will get destroyed along with it when the enemy is shot. So, I was wondering what the best way would be to set it up so that the wall object remains after the enemy is gone from the scene? Possible to detach the child before destroying the enemy?

Thanks

Edited original answer based on feedback

Here is how to unparent a child object before you delete yourself.

Transform child = FindChild(gameObject, "ChildName"); //Replace "ChildName" with the child objects name.
child.parent = null;
gameObject.Destroy();

And here is the FindChild method:

public Transform FindChildTransform(GameObject parent, string name)
{
	Transform child = null;
		
	foreach(Transform trans in parent.transform)
	{
		if(trans.name == name)
		{
			child = trans;
			if(child != null)
				return child;
		}
		else
		{
			child = FindChildTransform(trans.gameObject, name);
			if(child != null)
				return child;
		}
	}

	return child;
}