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 ASB · Jul 28, 2020 at 10:23 PM · scene-loadingloadingloading screenbest practices

Is there a perferred method for handling scene loading?

So my question basically is this:

When loading scenes in Unity is it better to load an empty scene then load the scene you are trying to reach or is it more efficient to just have a canvas UI cover the scene and wait for the scene to load directly then hide the canvas after the loading operation is complete?

I was curious about this, whether or not using one method over the other had any pros or cons as far as your application's performance goes. Maybe there are reasons you'd want to do one over the other?

I searched online for quite some time and failed to find anything regarding this topic so I decide to post here. Maybe it would be better off in the forum, but any answers from folks who have experience with this sort of thing would be greatly appreciated.

Thank you for your time.

Comment
Add comment · Show 3
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 ASB · Jul 29, 2020 at 04:11 AM 0
Share

I suppose it would be more helpful if I provided information about what I'm doing specifically.

I am currently working on a prototype project that will act as a template for future ones. The way I am handling scene management is by having a prefab object hold my load handling script that has an array of all my scenes' information and logic for figuring out which one it needs to load as well as a UI element for displaying graphics (progress bar, optional flavor text, etc.). This gets dragged around from scene to scene and gets called when I need it to load something. I've seen before where many people were not doing it this way and had a completely separate scene (not necessarily completely empty) that they would load before loading the actual scene they were trying to reach. In fact I found out that this seems to be the norm. This caused me to wonder what actually is the best method for doing this even if the benefits are only marginal...an every ounce counts sort of thing. I also thought that having an additional loading scene seemed slightly pointless unless there was something more visually interesting and complex going on, but then I thought that maybe I'm wrong and there was a reason for doing this even in a simple application which eventually brought me here.

For the purposes of my particular project, I am not doing anything too crazy such as stea$$anonymous$$g instances of multiple scenes at the same time. I am however using asynchronous loading.

Any additional thoughts from anyone would be helpful not only to me but to anyone who finds this topic interesting and has similar questions in the future.

avatar image scottishrob13 ASB · Jul 29, 2020 at 07:23 PM 0
Share

In terms of actual load time, not loading into a separate scene and not using asynchronous loading is the fastest. We typically use asynchronous loading for user-experience purposes. What you're doing by dragging an object around with you is basically equivalent to having a separate loading scene - however, it does mean that you're carrying that object in memory with you everywhere you go, rather than simply relegating it to a loading screen. That's about the only downside.

avatar image ASB scottishrob13 · Jul 30, 2020 at 04:26 AM 0
Share

Thank you for all the feedback on this. I figure that what I'm doing isn't necessarily bad though maybe atypical. At least it doesn't appear to be bad for the moment. Perhaps as my project grows the memory requirement may be more of an issue, but as it exists now there isn't even a measurable difference in performance doing it one way over the other.

Thanks again, cheers!

1 Reply

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

Answer by scottishrob13 · Jul 29, 2020 at 01:43 AM

It depends a lot on what your scene management looks like. The fastest method will be to load the next scene directly SceneManager.LoadScene("YourScene", LoadSceneMode.Single) which will unload the current scene first, so memory isn't a concern. However, this severely limits the amount of control you have. Loading an empty scene, and then the scene you're trying to get to will similarly lack control and won't be any more flexible so there's no reason for the extra step. Typically, you want to asynchronously load a lightweight loading scene (preferably with some sort of animated component so the player knows the game hasn't simply frozen up), activate it, asynchronously unload the original scene, asynchronously load in the next scene, activate it, and finally asynchronously unload the loading scene. How you hide the transitions at each step is flexible, especially since you're doing it all asynchronously and not freezing up the game. Of course, that's just for a simple case where you aren't merging scenes additively or trying to stream parts of large, open-world levels. That would require an entirely different set of approaches. As you get more complex requirements, the simple rules of thumb start to break down.

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

135 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 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 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 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 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 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 avatar image avatar image avatar image

Related Questions

How do I code just a Loading scene with text and pictures in unity3d c# 2 Answers

How to select scene based on device screen size? 1 Answer

unity LoadSceneAsync works like LoadScene 0 Answers

scene loader issue 0 Answers

Problems with Playerprefs script 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