You can see in the image I have a background image with some trees, and it is set to Preserve Aspect. So even though the screen has been set to a resolution with the wrong aspect ratio for the image, it’s still displaying properly.
The panel it’s on is larger than the image because of this. My problem is that I want the objects in the scene (the bugs) to maintain their location relative to the image, not the panel.
The anchors care about the panel’s size, not the image’s size. Is there a way for me to get this to work?
I’ve tried using an AspectRatioFitter as suggested by one of the answers, and I get this. The blue dots show the size of the fitter is correct, but its anchors are in the same place as the parent RectTransform, which means it doesn’t change the location behavior of the objects.