Instantiating prefabs with editor script is breaking the prefab connection.

Hi there,

I have an editor script that puts a bunch of instances into each scene. It seems to work okay but for some reason it breaks each instantiated gameobject’s prefab connection.
Is there a way to instantiate GameObjects and keep the connection to the prefab objects?
Like if you’d dragged them into the scene manually?

Any help would be great, Thanks!
Pete

Don’t use Object.Instantiate, use PrefabUtility.InstantiatePrefab instead.

2 Likes

Thanks! You RoCk! :smile: