0
\$\begingroup\$

I'm trying to port over a card game I wrote some years ago into Unity (2D, Orthographic). The game objects are placed correctly when I build and run in Windows, Linux, and Mac, for all the different resolutions I've tested. It also looks fine on my S7 phone (16:9 ratio). However, on my newer Android phone (18:9), the elements collide vertically. I've tried changing a bunch of parameters in Unity's canvas settings, such as Match Width/Height, UI Scale Mode, etc., and I've tried different values in the Build | Android Player settings: Aspect Ratio, start in Fullscreen, etc. but nothing is changing.

Can anyone help? I'm fine with black bars on the side to keep it at 16:9, if I can't force it to lay out the objects with vertical priority somehow.

Thanks.

Android screenshot Canvas settings

\$\endgroup\$
  • \$\begingroup\$ Can you show us how you configured the match width/height setting, including the slider controlling which one to match? \$\endgroup\$ – DMGregory Nov 10 '19 at 5:30
  • \$\begingroup\$ Here you go. I tried the slider at Width (0) and Height (1.0) but no change in the result. I've only been using Unity for a month or less. I designed it at 16:9 and it looks correct running at 16:9. When I run it at a 4:3 ratio, the vertical elements are spread apart more, which is fine. But when running at 18:9, the vertical elements are compressed and collide. It's as though the layout stretches appropriately to the width, but then separates or compresses the vertical elements to get the aspect ratio. I'd prefer it do the reverse, which I thought the Width/Height slider would do. \$\endgroup\$ – ExNASATerry Nov 10 '19 at 19:38
  • \$\begingroup\$ Okay, after reading more about the W/H slider, it seemed that should have worked so I tried it again, and it did. Not sure what I did wrong before; maybe it didn't get moved onto my network server properly before I side-loaded it to my V30. Anyway, it seems to work now. Thanks. \$\endgroup\$ – ExNASATerry Nov 11 '19 at 0:15
  • 1
    \$\begingroup\$ Please consider posting an answer showing the configuration that solved your problem. \$\endgroup\$ – DMGregory Nov 11 '19 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.