- Home /
gameobject.transform.parent not assinged after deploy
I'm developing a Unity application for Hololens.
In my scene I have a sort of base on which I dinamically load a 3D model from OneDrive. Both the base and the model need to be children of a container GameObject so that I can scale the up and down with a single operation and process them as a single unit.
I've noticed that if I run a mockup inside unity editor all the above operations are successflully handled (the access to OneDrive through FileOpenPicker works only in UWP). If I build and run the application the 3D model is correctly loaded and displayed but not assigned as child of my container.
item.transform.parent = ModelContainer.transform;
UnityEngine.Debug.LogWarning("AddGoToBundleList -> " + item);
UnityEngine.Debug.LogWarning("parent " + item.transform.parent.gameObject);
item.transform.position = new Vector3(0.5f, 1.93f, 5.6f);
var rotation = new Quaternion();
rotation.eulerAngles = new Vector3(0, 150, 0);
item.transform.localRotation = rotation;
Instantiate(item);
The same code if executed inside the unity editor works.
Does anyone has any suggestion on how to fix this issue? I'm not understanding what I'm missing
Your answer
Follow this Question
Related Questions
How to use unityeditor and where I need it? 1 Answer
PlayerPrefs not saving on Windows Devices but saving on Unity Editor and Android. 0 Answers
Design approach opinion needed on tilemap vs gameobject 0 Answers
Why Unity crashes and how can I fix it? 0 Answers
How to find object references internally in a scene 2 Answers