Hi Everyone, I have several problems to compile the entire project. Array values works well on editor, runtime, etc... but when compile project array values are slided, moved one value up.... This is normal? please, help with that.. 2019.1.f1v thank you!!!
- - - - //create// GameObject[] sockets,sockets_ene,sockets_sk,sockets_ene_sk; ... // initialize// sockets = GameObject.FindGameObjectsWithTag("cp_player"); sockets_ene = GameObject.FindGameObjectsWithTag("cp_ene"); ... // use // //ICE for (int j = 3; j > 0; j--) { // player cont_freeze[j]--; Mathf.Clamp(cont_freeze[j], 0, 10); if(cont_freeze[j] == 0) { if (sockets[j].GetComponent<check_prox>().myself) { sockets[j].GetComponent<check_prox>().myself.GetComponent<states>().freezed = false; sockets[j].GetComponent<check_prox>().myself.transform.Find("ice_crystal").GetComponent<Image>().enabled = false; // unfreeze sfx //GameObject.Find("sound_manager").GetComponent<sound_manager>().launch_sfx(); } } } for (int k = 3; k > 0; k--) { // ene cont_freeze_ene[k]--; Mathf.Clamp(cont_freeze_ene[k], 0, 10); if (cont_freeze_ene[k] == 0) { if (sockets_ene[k].GetComponent<check_prox_ene>().myself) { sockets_ene[k].GetComponent<check_prox_ene>().myself.GetComponent<states>().freezed = false; sockets_ene[k].GetComponent<check_prox_ene>().myself.transform.Find("ice_crystal").GetComponent<Image>().enabled = false; // unfreeze sfx //GameObject.Find("sound_manager").GetComponent<sound_manager>().launch_sfx(); } } } ..... when sockets[] is fail(slide values up) when compile..... thnx in advance!!
i'd check first if this returns the same amount in editor and in build: sockets = GameObject.FindGameObjectsWithTag("cp_player"); try some Debug.Log(sockets.Length); If you initialize in Start or Awake, some other script with Start, Awake might run before or after.. in that case, can use execution order, https://docs.unity3d.com/Manual/class-MonoManager.html
I have a problem which I doubt is unheard of, but for the life of me I cannot find with the search tool. Hence the new topic Myloweslife. My apologies if this is already known and I didn't google it right.