Why does everything move around as the screen size changes?

Is there a way to make a game look the same no matter the screen size? I try to set a default screen width and height for the game but it creates something different when I actually build it. I want my buttons to be at the edge of the screen but somehow it gets pulled towards the middle in the build. Is this something
I can fix or just a limitation of Unity?


To answer this question requires knowledge of the objects. I assume the health/accuracy buttons are UI Elements like UI Buttons, and UI Text, and the guns are UI Images. Assuming you are using the new UI here is a good video on how the RectTransforms work and how to use them:

But for a specific example. If you click on your Acquire Target Button. Click on its rectTransform in the Editor. Now click on the bottom+Left button while holding Alt and shift (this will be the button directly above the actual bottom-left button – that one is left-stretch). Now your acquire target button will always position itself in the bottom left corner. You can then modify the POS X and POS Y to push it out from the edge. (say 15 in each). Now no matter what resolution, it will always be 15 pixels up and left of the bottom left corner. You can do this with all the UI elements. Play around with various Anchor settings and offsets.

One good trick for that entire bottom left group (health/accuracy/attack/acquire target) is to Create a UI Panel then make all 4 of those items childrens of it. Add a Vertical Layout group to the panel and it will auto layout all 4 items vertically inside itself. Then you can just do the above RectTransform steps on the panel itself and the entire group will posiiton correctly.