Unparent an inactive object and then destroy the parent and activate the child

I have a Gameobject with an inactive Child. This parent is going to be destroyed. I need the child to become active when the Parent is destroyed. Therefore I need the child to be unparented before the parent is destroyed. I need a script for this which is to be added to the Parent. Is there a signal that “Destroy(Parent);” produces I can use in the unparenting logic? Also, can someone link a tutorial for this kind of Unparenting?

You really should not post multiple threads with the same question

I got the parenting question after your first reply. But duly noted. I got it working now. Thank you so much!