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 loserman778 · Feb 04, 2015 at 09:41 PM · 2dcamera-movementresourcesparallax

What uses less resources, a stationary camera with a moving background, or moving camera with a stationary background?

Hello everyone, I'm working on a game, in 2D, that features a cannon and something that shoots out of the cannon. The camera will then follow the cannon ball out of the cannon and go through different environments.

My question is, is it a better idea to keep the cannon ball and camera stationary and create a background that scrolls by. Or should I make the ball move through the unity space and have the camera follow it and create the background in front the camera and delete it as the ball move.

Which one of these options would be the most resource friendly. In addition, which one of these would be easier to code.

Any input is appreciated, if you need me to clarify anything, please ask me to.

Thanks for your help.

Comment
Add comment · Show 2
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 DanSuperGP · Feb 04, 2015 at 11:40 PM 1
Share

As a general rule... figure out the easiest way to make it work... then if it's not efficient... figure out how to make it more efficient.

Pre-optimization is the death of success.

avatar image loserman778 · Feb 05, 2015 at 01:51 AM 0
Share

Good advice, i'll follow this in the future.

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by AlwaysSunny · Feb 04, 2015 at 09:39 PM

In practice, efficiency tends to follow logic. At least in this case, it stands to reason that moving two objects is less expensive than moving hundreds. Even if it's all parented to a single object, (which probably should reduce internal calculations.. worth testing), it doesn't make the operation cost-free.

I guess if your environments go on and on such that you're already talking about deleting parts of it on the fly, you may need to load it on the fly as well. In that case, and depending on sizes and required floating point precision, having a moving environment might make more sense. All kinds of fiddly problems arise from atypical environments.

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 AlwaysSunny · Feb 04, 2015 at 09:42 PM 0
Share

Also worth mentioning, if your environment is physically interactive, it's probably best to use the fixed environment. $$anonymous$$oving colliders around is expensive no matter what.

avatar image loserman778 · Feb 04, 2015 at 11:35 PM 0
Share

Awesome, This is great info to know. Thanks for your help, I really appreciate it.

avatar image
1

Answer by DanSuperGP · Feb 04, 2015 at 11:41 PM

The moving camera is a tremendously better choice. The other ways is madness.

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

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to Manually Move the Camera Horizontally or Vertically? (2D, Parallax), 0 Answers

Camera wrapping 0 Answers

Most efficient way to achieve 2D parallax effect with orthographic camera? 2 Answers

Pixel perfect multiple cameras 0 Answers

Camera Script Making Player Vanish 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