Detect when a gameobject is added to the heirarchy

Hello,

Is there a hook of some kind that can detect when a GameObject is added into the Scene Hierarchy?
The plan is to evaluate these new objects and set their correct parent automatically.

Thanks :smiley:

I think a good starting point is to use OnHierarchyChange, after that you can find all the gameobjects in the scene and perform the reparenting.

Actions that trigger this message
include creating, renaming,
reparenting, or destroying objects in
the current hierarchy

The ideal would be to have an event that brings the newly created object as an argument, but I don’t know that there is one available.