I have a scene with 2d elements covered in Unity UI elements. I built this scene in a 1024x768 window. The UI elements are on a canvas with a Reference Resolution of 1024x768 because before I did that, when I scaled the scene the UI was not scaling. Now when I scale the scene, as long as the Game is set to 1024x768 it works. Even when I scale up and down, the UI stays in the right place.
Where I am running into an issue is when changing aspect ratios to anything other than 1024 x 768. I have attached two pictures to demonstrate. The first picture is what I am hoping to achieve in all aspect ratios. The red boxes are correctly in place over the first row of blocks. When I change aspect ratios, however, the red blocks do not move with my scene. This is visible in the second picture.
The reason I am confused is because as you can see in the second picture, my background and all of the 2d elements ARE staying the correct size relative to one another. There is space on either side of the scene, but I am ok with that because it is scaling correctly. The UI elements are not.
I was wondering if the Reference Resolution is causing an issue because it is set to 1024x768. I am using an Overlay canvas… is that the issue? I am having trouble determining what steps I would need to take to achieve what I am looking for… for the UI to remain in the correct spot compared to my other content no matter the screen size.

