• 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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

Reset VR camera i.e. OpenVR Recenter i.e. vr player death 1 Answer

Massive black bar on the edge of the screen 1 Answer

How does one prevent their Android Build from being transparent? 0 Answers

ScreenToWorldPoint() not working properly using a RenderTexture 1 Answer

Setting perspective camera origin 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges