I have 2 prefabs, they need to have an object reference to parent themselves to that object. But, when I make it a prefab, it changes the Transform reference to Missing. What can I do about this?
If you want a prefab that is not in the scene to have a reference to something in the scene, it is not possible.
You will need to find the reference you want by code. when you instantiate.
reverse the dependency order
prefabs exist in a scope outside of a single scene, so if a scene object and a prefab need to have some relation, make the scene object control how the prefab is dealt with in the scene.
So if you have some script on the prefab setting it to its parent, instead rewrite the script to be on the parent that places the prefab inside itself.
2 Likes