GUI elements not showing on android (SOLVED)


#1

Hi,

I have a game which consists mainly in dynamically created GUI elements. It works fine while testing on the PC, but when testing on an android phone, some of those dynamically created elements show for a while and suddenly they don’t.

If I navigate in another part of the game and come back, then those elements that were not showing magically appear.

I used adb logcat in the hope there would be a crash in the gui_script, but without success.
I used the visual profiler to view the quantity of GUI nodes, it’s (I think) quite low - around 60 - and very stable.
Now I have no idea what to look for, maybe you have an idea about the parameters I should check first ?

Thanks


#2

Are you by any chance changing/setting the nodes Z position component? It should be at 0 (in most cases), the draw order is automatically taken care of in GUIs, but their Z value can still be “incorrectly” set outside -1 and 1 by a user.


#3

I just checked and neither in script nor in the editor the Z component is ever touched. It’s always 0.


#4

Will you upload a demo project so we can test it fort you.


#5

Sorry for late response.
Unfortunately I can’t share any code, there’s too much to be able to simplify it enough, and I can’t share it as is (other team members wouldn’t agree with that).
Fortunately, I found the bug, which was actually in my code and was in no way related with gui objects. Sorry for the inconvenience…