- Home /
Question by
MuseumTourGames · Oct 28, 2013 at 04:09 PM ·
gameobjectpositionloadingjsonforeach
JSON Loading of Position
Okay, so I have tested the JSON portion of this code, and it is all working (reading/writing properly). Just assume the JSON methods are all working as implied. Can anybody tell me why this code does not load the positions of these objects at run-time?
// Load Settings
JSONObject json = JSONObject.Parse (settingsFile.text);
foreach (GameObject setting in optionsMenu.GetComponent<OptionsMenuScript>().settingsArray) {
Vector3 settingLocalPosition = setting.transform.localPosition;
settingLocalPosition.x = json.GetNumber(setting.GetComponent<tk2dTextMesh>().text);
setting.transform.localPosition = settingLocalPosition;
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613120812im_/https://answers.unity.com/themes/thub/images/avi.jpg)