So I did a game for android, and it includes UI text to display the score. I used Screen.width and screen.height to position the text and resize it according to the screen. I ran the script in editor and even in unity remote, and all worked fine. I tested it on multiple screen resolutions and none had any problems. Then I downloaded it onto my phone and the text was nowhere to be seen. According to a debugging text I left there, it was somewhere very far away. I tested it again in editor and downloaded it again. Everything worked in editor, but not in the build. I tried to Google it, but now I am out of ideas… if anyone can figure out what’s going on, I’d greatly appreciate:)
Is your canvas set to Scale with screen size, and is your text anchored? If this is the case, your text will always appear in a relatively similar place as on any other resolution.
Another thing to note, in the editor, when using Screen.width
, or Screen.currentResolution.width
, it takes into account, not the resolution set in the game view, but your pc itself. This may cause issues with UI and object placement if your mobile aspect ratio is different to your computer’s. @olaka1