Search Unity

PC and Android do not work in the same way

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

  1. scythwolf

    scythwolf

    Joined:
    Dec 30, 2018
    Posts:
    16
    Hi!

    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);
    2.  
    3.         int tmp_id = 0;
    4.  
    5.         foreach (GameObject i in imageObjectArray) //if objecttexts from unity match activate object...
    6.         {
    7.             if (blenderObjectArray[id].name == i.name)
    8.             {
    9.                 i.SetActive(true); //...then set object active..
    10.                 findTextToObject(i.name); //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!