简体   繁体   中英

World Scale for mobile in Unity?

I'm experimenting with android apps in the unity engine, but I'm having problems where the gameobjects in the world don't scale with the device. Unity has all sorts of tutorials for UI scaling, and my UI scales fine, but I don't see any Unity documentation for anything like this.

For context the game is a very simple puzzle type game where you throw a ball by tapping on the screen, the ball then bounces off objects to get to a goal.

Sorry about my poor drawing skills, but I think it gives to best example of what's happening.

I designed my device scale for a Galaxy Note 10, and it looks fine:

在此处输入图片说明

But when I play the game on a smaller/older device, you can't see what happening in game because everything is too big:

在此处输入图片说明

And on an even larger device like a tablet, things are way to small:

在此处输入图片说明

How do I get my world to scale for different resolutions and aspect ratios, but and the same distance between objects so that I if the ball it launched in the same direction on all devices it will bounce off objects in the same places and hit or miss the target in the same way on all devices?

If you look at the reviews for the asset that someone commented you will find this

In Unity 2018.2 and above, you can now tick the "physical camera" box on any camera, and set the gate fit to "overscan". Then, just make sure that the sensor size is 16:9, or whatever your "reference aspect ratio" is. You can also experiment with other gate fits depending on your needs.

Since you already tried overscan and it didn't appear to work I will look at other options. After reading the entire unity manual on physical cameras, change the gatfit to none. This will stretch the image to fill the screen but your scene fits most devices so don't worry about stretching.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM