Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

PC and Android do not work in the same way

Discussion in 'Vuforia' started by scythwolf, Jul 24, 2019.

  1. scythwolf


    Dec 30, 2018

    I developed an app for Android. Everything works fine on the PC but on my mobile it is executed in a different way:
    I have toggles with wich you can choose the object to display. If an object is chosen I pass an id to the function wich then finds the right object while the sprite is found by the name both share.

    Code (CSharp):
    1.         blenderObjectArray[id].SetActive(true);
    3.         int tmp_id = 0;
    5.         foreach (GameObject i in imageObjectArray) //if objecttexts from unity match activate object...
    6.         {
    7.             if (blenderObjectArray[id].name ==
    8.             {
    9.                 i.SetActive(true); //...then set object active..
    10.                 findTextToObject(; //and find the proper text to it in form of the right ID for the textarray.
    11.             }
    12.             tmp_id++;
    13.         }
    The gameobjects get filled inside start() using tags.
    Code (CSharp):
    1.         blenderObjectArray = GameObject.FindGameObjectsWithTag("blenderObject");
    2.         imageObjectArray = GameObject.FindGameObjectsWithTag("imageObject");
    1. Everything is working fine on the pc. But on the mobile one the object declared to be active when the app starts is displayed.
    2. Also one sprite never acitvates even if chosen. If you click it the toggle sprite below gets activated.

    Can anyone tell me why the difference is happening between pc and the app?
    Thank you!