Attach object when NOT in Hierarchy

Hey, I’m new to Unity, which makes me pretty bad at it. I’ll try to explain my problem as good as I can.

I have an object saved, which I will spawn when a certain thing happens. I want to attach an object to that object, but it only works when that object is out in the Hierarchy. How do i solve this?

Pics:

When the object is saved, but not out in the Hierarchy. (doesnt work to attach)
[35726-skärmklipp+2014-11-24+18.24.20.png|35726]

When the object is out in the Hierarchy, it’s possible to attach them.
[35727-skärmklipp+2014-11-24+18.24.32.png|35727]

How do I fix this? Is it a way?

This cannot be done.

This is because you can instantiate a prefab in any scene. Unity has no guarantee that the hierarchy object will exist at runtime. You can link in another prefab. Or you can use GameObject.Find via script to get an instance at runtime.