referencing Prefab in Inspector from another Scene

Hi,

in scene 1 i have a prefab “prefab1”, which i want to continue to use in scene 2 with DontDestroyOnLoad().
In scene 2 i have a Gameobject which needs to access prefab 1.

When i drag & drop prefab 1 in the inspector of Gameobject and play my game, in scene 2 Gameobject can’t find prefab 1 (it’s in the scene 2). I can bypass this by using Gameobject.Find(), but shouldn’t it work without reassigning it via code?

The key problem here is that you are referencing a prefab, but the item you call “Prefab1” is actually a GameObject when Intantiated into a scene. You will have to use GameObject.Find because the reference to the prefab is not the same as the GameObject with DontDestoryOnLoad(). This is a common sticking point, and I know I had the same trouble.

For a full rundown of GameObjects vs Prefabs, check out this comprehensive answer: http://answers.unity3d.com/questions/46124/what-is-the-difference-between-a-prefab-and-a-game.html