Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jan 06, 2017 at 01:26 AM by JoshBaz for the following reason:

The question is answered, right answer was accepted

avatar image
1
Question by JoshBaz · Nov 17, 2015 at 02:29 PM · cameragui2d-platformerzoom

Unity2D - Camera in exported game is zoomed out compared to unity game preview HELP PLEASE!

Ok so I'm making a 2d game, when designing the UI of the main menu or the HUD in levels everything looks fine in the game preview but when I test the game on an actual device the camera is zoomed out and the HUD in levels are out of place. Please help me with my problem I'm new to Unity. If this question is answered somewhere else please redirect me to it. I will accept any help I can get. Here are some screenshots of what happens:

How it looks in Unity:alt text

How it looks on the exported game: alt text

That blue space around is part of the screenshot. I set the background color of the MainCamera to blue. I shouldn't be seeing it since i focused my camera on the UI in screenshot one.

wp-ss-20151116-0002.png (128.3 kB)
capture.png (166.5 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

  • Sort: 
avatar image
1
Best Answer

Answer by _Game_Dev_Dude_ · Nov 17, 2015 at 05:22 PM

There is a little box underneath your game view that says "Free Aspect". This is your problem I would wager. This needs to be changed to the target size of your deployed build. So for example, you can make a new aspect of 16:9 and then set your game view to this and it will look how it will look on a 16:9 display.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JoshBaz · Nov 17, 2015 at 09:17 PM 0
Share

Please explain more. How exactly do i go about doing that. Does changing the aspect in the game preview window automatically affect the screen size of the target build? Thanks.

avatar image _Game_Dev_Dude_ JoshBaz · Nov 18, 2015 at 09:03 AM 1
Share

Basically that button allows you to preview what your game will look like on different resolutions. It does NOT effect build settings, target resolution, or anything like that it is strictly a tool you can use to preview how your game will look.

So if you know what you are deploying to, for example a 16:9 phone, you can change it to 16:9 and do all your layout work from there.

When you click the Free Aspect button, a drop down should come up with the most common aspects. However there is a small plus sign at the bottom of the drop down that you can use to create a custom one. This can be either resolution (1920 x 1080, etc) or an aspect (9:16, 4:5, etc).

I think what is happening is right now your game window is so small that free aspect is causing it to be shaped based on a very low resolution. When this gets exported to a bigger screen it fills that space with the blue background. I would pull the game window out and let it be fullscreen and then set the resolution/aspect as I described above and then see how the game looks.

avatar image
0

Answer by tanoshimi · Nov 18, 2015 at 10:15 AM

I'd also encourage you to learn about the canvas scaler component: https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/resolution-and-device-independence

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

flickering lines when zooming fov (both GUI and ortho cameras). 2 Answers

Moving camera around with GUI buttons 4 Answers

Is there a way to zoom GUI and scene at the same time? 0 Answers

camera zoom using gui button 2 Answers

Raycast misses after camera zoom 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges