- Home /
Question by
Rajpriyadarshi · Jun 14, 2021 at 10:29 PM ·
unity 5not workingapk
Gameobject is not at assigned position. All works good in unity play mode but its all messed up in apk after build.
//this is the script i use to enable mesh renderer. I have used object pooling so whenever i want to add players i transform its position to where I want it and then enable the mesh renderer component.
if (gameObject.tag == "Add10" && other.tag == "InstPlayer") { if (other.GetComponentInChildren<SkinnedMeshRenderer>().enabled == true) { for (int i = 0; i < total + 10; i++) { gameObject.GetComponent<BoxCollider>().enabled = false; pp.pooledPlayers[i].GetComponentInChildren<SkinnedMeshRenderer>().enabled = true; foreach(GameObject ob in spawnPositions) { if (ob.name =="Pos"+(i+1) ) transformTo = ob.transform.position; } Debug.Log(pp.pooledPlayers[i].transform.position); pp.pooledPlayers[i].transform.position = transformTo; } total += TotalPlayersActive(); } }**
"Pos" is the position I want to transform to. "pp" is reference to PlayerPool script. Everything works good in unity playmode but when I build it and run apk on android it gets all messed up. Please help I just cant make it work.
Comment
Your answer
Follow this Question
Related Questions
Point Light shadows not working on older projects 0 Answers
Button Audio working in Editor, but not in apk build. 0 Answers
Unity buttons stopped working on Editor 4 Answers
Problem Integration Facebook with Unity 5 On Android 0 Answers
Unity3d android apk file becomes huge without any scene 0 Answers