Quantcast
Channel: Questions in topic: "prefab connection"
Viewing all articles
Browse latest Browse all 103

PrefabUtility.InstantiatePrefab not preserving prefab connection

$
0
0
This simple Editor tool to instantiate Prefabs is doing so, but the instantiated objects are missing their connection to the prefab (aka not blue, updating prefab doesn't show changes in copies). [ExecuteInEditMode] public class FixMazePrefabConnections : MonoBehaviour { foreach (GameObject maze in mazes) { // Instantiate blank maze GameObject newMaze = PrefabUtility.InstantiatePrefab(blankMazePrefab) as GameObject; } } I've tried suggestions like using: EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); and: Undo.RecordObject(newMaze, ""); to no avail. Any clue what I can try to preserve the connections?

Viewing all articles
Browse latest Browse all 103

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>