Hey, so I am making a game, where you can build your own things, by than i mean, you can join things with hingeJoints and i foud a way to save it with script like that:
static function CreatePrefab() {
var objs = GameObject.Find("Core");
var go = objs;
var localPath : String = "Assets/Resources/" + go.name + ".prefab";
CreateNew(go, localPath);
}
static function CreateNew(obj : GameObject, localPath : String) {
var prefab : Object = PrefabUtility.CreateEmptyPrefab(localPath);
PrefabUtility.ReplacePrefab(obj, prefab, ReplacePrefabOptions.ConnectToPrefab);
}
And it works while i am In Unity… When I am trying to build I have errors:
Unknown identifier: ‘PrefabUtility’.
Unknown identifier: 'PrefabUtility'.
Unknown identifier: 'ReplacePrefabOptions'.
Is there any way of going arround this? if not, how do i save it then, like other games do?