Child-saving script

Hi, I have small problem with my script. There it is:

void OnDestroy() {
	// I'll just save all children (bullets)
	foreach(Transform child in transform) {
		Debug.Log("Rescued: " +;
		child.parent = null;

I have object with children (ship with bullets). When ship is destroyed I’ll save children and destroy them in other way.
My code works at half. Really all my bullets are still alive when parent is killed, but colliders and scripts attached to them are disabled. It’s a little strange behaviour and I have no idea what happend.
Could anyone help?

Ok, I found solution for this problem so I leave this for comunity:


I think problem was because before “OnDestroy” method something was done in Unity so my objects was disabled, but when I call DetachChildren(); direct before Destroy() method - everything works fine.