Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by fsehat · Mar 29, 2014 at 10:52 AM · cameraunity 2dstatic

Unity 2D - static camera, static background

How to create a very basic and static 2D scene with unity ? Almost everywhere in the web, all tutorials talk about simple examples with parallax backgrounds, multilevel games, etc. I want to know how can we create:

  • A very basic square scene with

  • for example, one sprite as background and

  • one camera covering only the square background and nothing else.

PS: All my attempts finished with the camera showing the square but with blue field around it.

PS: The camera does not need to follow anything, in fact all animations or interactions tend to be in the only one square field in the scene.

PS: I am a newcomer to the Unity world.

Comment
Add comment · Show 4
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 Destran · Mar 29, 2014 at 11:01 AM 0
Share

You can scale the square to take up the entire space of the camera by selecting the square and hitting "r" and then dragging on the boxes to scale it properly.

avatar image fsehat · Mar 29, 2014 at 11:05 AM 0
Share

The problem is that the camera space seems to be only rectangular.

avatar image Destran · Mar 29, 2014 at 11:44 AM 0
Share

Try posting a picture of your problem, because it sounds like you should be able to just scale your background to fit the camera.

avatar image Destran · Mar 30, 2014 at 01:16 PM 0
Share

I didn't actually watch this video, but It seems like it could be useful?

https://unity3d.com/learn/tutorials/projects/space-shooter/adding-a-background

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by koray1396 · Mar 29, 2014 at 12:53 PM

blue area is unavoidable, if you play a square game on a rectangular screen, what should it show for the remaining areas? You can put some black background behind, so that would give you your square, and some black areas instead of blue.

you can try to set camera.aspect to 1. You can do this with a script attached to the camera. However, if you play this on a rectangular screen, the game will be stretched, and will look ugly.

You may want to check scripting reference for these.

https://docs.unity3d.com/Documentation/ScriptReference/Camera.html

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 fsehat · Mar 29, 2014 at 01:26 PM 0
Share

Thx for your answer. So, is it possible to replace the blue color by a background image ?

avatar image koray1396 · Mar 30, 2014 at 12:55 PM 0
Share

Yes you can change it from settings (player settings, not sure). But i think it would be better to put an object with black texture. You can put it back by changing the z position.

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

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Move the camera in 2D when target reaches bounds. Is there a better way? 0 Answers

Get mouse position relative to camera 2 Answers

Camera Shaking Problem 0 Answers

Particle System 2D dont works in Game 0 Answers

Camera to move when i move to the next room 1 Answer


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