When the game is ran in the inspector (With a HTC One M7 connected via USB) the UI shows up like it is designed to. But when the build is ran on the device solely, the UI is messed up. What causes this and can it be set to scale according to the resolution of the device being used?
This is a very common issue with canvases exporting to mobile devices. On your Canvas GameObject, find the “Canvas Scaler” script. From the “UI Scale Mode” drop-down, set the scale mode to “Scale With Screen Size.” Then, rebuild. Note, when you first change it - your UI will likely jump around and appear much smaller. It’s necessary to fix the UI the way you want it before continuing.
What are your canvas scaler settings?
Also, are you instantiating anything?
if it isn’t already added, add this to your canvas and set the UI scale mode to scale with screen size. For me it worked best to put the match to half way between width and height.