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 /
  • Help Room /
avatar image
1
Question by machop21 · Mar 10, 2016 at 09:40 AM · cameraandroid buildnewbieviewportgame view

Camera and Game View Different From Build

I have been working on a 2D game for some time now, and I set up the scene to fit into the "Camera View" and viewport that I first had when starting my new project. I opened up Unity this time, and I've noticed that my "Camera View" and viewport are VERY WIDE, even though I don't remember changing anything. Fortunately, when I "Build and Run" my game (Android) it still reflects as though it had it's original camera size, thus showing a full-screen background sprite. However, I would like my "Camera Preview" and "Game View" to reflect my original camera size, like my actual game build does.

Originally I thought changing the "Viewport Width" manually to a size similar to what it used to be would work, but that makes it so that the built version is clipped on one side, so I need to stick to a 1:1 ratio. Please help me get my original camera and camera preview back~

EDIT: Okay, so it seems that the "Camera Preview" and what appears to be the viewport box are actually just resized according to the size of my scene view window/panel in the editor. That makes absolutely no sense to me.....

So, NEW question: Is there a way to preview what my game will look like on devices? I thought what you put inside the "Camera View" was what got stretched full-screen on the device. Now that I know that's not the case, how can I know what is going to be shown? How will I know where to put things?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by KdRWaylander · Mar 10, 2016 at 09:46 AM

Hi, about your new question:

  1. Start by setting the resolution you want for your app in the Build Settings (File > Build Settings > Player Settings)

  2. In the Game view/tab, click on the resolution button which generally displays "free aspect", just underneath the name of the tab (upper left part of the Game view) ... and set the Game view to your wanted resolution.

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 machop21 · Mar 10, 2016 at 05:00 PM 0
Share

In the player settings the only thing that I can change is whether it is Landscape or Portrait. In the Game view there are several "Landscape" resolutions--is this how my game will look on devices with the respective resolution?

If that's the case how can I, let's say, make sure a monster shows up a quarter screen length from the side of their screen no matter which device they are using?

avatar image KdRWaylander machop21 · Mar 10, 2016 at 05:21 PM 0
Share

You can change the resolution, when in the player settings, in the Standalone tab.

Forcing the resolution to a certain ratio will indeed show you how it will be displayed at the end.

If you're using a Canvas, you can set the Canvas Scaler component to "Scale with Screen Size" so it'll keep the same aspect whatever the resolution is (but you'll see the pixels if you switch to a wider resolution)

You should be able to get the screen height and width, use them to place your enemies accurately (like x = 0.25 * screen.width)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

HOW TO - Camera Viewport Rotate OR Mask OR Transparent? 0 Answers

Layered/slanted camera view 0 Answers

Converting World coordinates to Viewport in split screen 1 Answer

Viewport affecting custom projection matrix 0 Answers

Game window is blurry?! 0 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