Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

ProfileUtility.InstantiatePrefab returns null in Unity 4

$
0
0
I'm working on a tool that will build a 2D level based on info from a text file. When the text file is imported, I want to create instances of the game objects that retain their connection to a prefab. In Unity 4, when I do this: Object prefabRoot = EditorUtility.GetPrefabParent (sprite); GameObject dupe = EditorUtility.InstantiatePrefab (prefabRoot) as GameObject; the `dupe` object is null. The documentation seems to suggest that it shouldn't return null. - http://docs.unity3d.com/Documentation/ScriptReference/PrefabUtility.InstantiatePrefab.html If InstantiatePrefab will always return null, is there any other way to accomplish what I'm trying to do?

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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